Change implementation from 3 mutexes to one semaphore and rwlock in sod thread sync lab