The weak shared object hash can be accessed by multiple threads, so it must
be locked.