Added a 2nd semaphore to separate reader and writer lock