changed mutex to shared_lock as global_context::get() does not need exclusive locking