Some more code. Fails somewhere thanks to either lock or unlock.
Mhm.
Fixed (singlethreaded!) deadlock, removed redundant locking.
Fixed an irritating #PF.