Priority inheritance

Implemented priority donation for locks primitive to avoid priority inversion issue.