Thread-safety workaround 

via enforcing single-threaded execution even in multithreaded environments. Not a final solution.