read-write lock and deadlock

read-write lock and deadlock