Fixed locking for multithreaded executions