25 #ifndef WSHAREDOBJECTTICKETWRITE_H
26 #define WSHAREDOBJECTTICKETWRITE_H
29 #include <boost/shared_ptr.hpp>
32 #include "WCondition.h"
33 #include "WSharedObjectTicket.h"
39 template <
typename Data >
72 WSharedObjectTicketWrite( Data& data, boost::shared_ptr< boost::shared_mutex > mutex, boost::shared_ptr< WCondition > condition ):
74 m_lock( boost::unique_lock< boost::shared_mutex >( *mutex ) )
81 boost::unique_lock< boost::shared_mutex >
m_lock;
94 #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.