ReadWrite lock now supports a thread with a write lock acquring read locks to fix deadlock hazard.