Os locking primitives

Locking primitives project branch.