Locking stuff1
Locking stuff2
Fixed a race condition in MessageLock.