Possible Duplicate:
Example for boost shared_mutex (multiple reads/one write)?
I am trying to use the shared_lock
and unique_lock
libraries from boost to implement a basic reader-writer lock on a resource. However, some of the threads accessing the resource have the potential to simply crash. I want to create another process that, given a mutex, monitors the mutex and keep track of what processes locked the resource and how long each process have the lock. The process will also force a process to release its lock if it has the lock for more than a given period of time.
Any suggestions on how to approach this problem is greatly appreciated!