25 #ifndef WSHAREDOBJECTTICKETWRITE_H
26 #define WSHAREDOBJECTTICKETWRITE_H
28 #include <boost/shared_ptr.hpp>
30 #include "WCondition.h"
31 #include "WSharedObjectTicket.h"
37 template <
typename Data >
70 WSharedObjectTicketWrite( Data& data, boost::shared_ptr< boost::shared_mutex > mutex, boost::shared_ptr< WCondition > condition ):
72 m_lock( boost::unique_lock< boost::shared_mutex >( *mutex ) )
79 boost::unique_lock< boost::shared_mutex >
m_lock;
92 #endif // WSHAREDOBJECTTICKETWRITE_H
Class which represents granted access to a locked object.
Wrapper around an object/type for thread safe sharing of objects among multiple threads.
virtual ~WSharedObjectTicketWrite()
Destroys the ticket and releases the lock.
WSharedObjectTicketWrite(Data &data, boost::shared_ptr< boost::shared_mutex > mutex, boost::shared_ptr< WCondition > condition)
Create a new instance.
boost::unique_lock< boost::shared_mutex > m_lock
The lock.
Class which represents granted access to a locked object.
virtual void unlock()
Unlocks the mutex.