writerLock
Locks @lock for writing. If @lock is already locked for writing or reading by other threads, this function will block until @lock is completely unlocked and then lock @lock for writing. While this functions waits to lock @lock, no other thread can lock @lock for reading. When @lock is locked for writing, no other thread can lock