added deadlock debugging
Added RLock debugging
Better logoutput
Merged locking
Merged locking debug code