25 #ifndef WSHAREDOBJECTTICKETWRITE_H
26 #define WSHAREDOBJECTTICKETWRITE_H
29 #include <shared_mutex>
32 #include "WCondition.h"
33 #include "WSharedObjectTicket.h"
39 template <
typename Data >
76 m_lock( std::unique_lock< std::shared_mutex >( *mutex ) )
83 std::unique_lock< std::shared_mutex >
m_lock;
Class which represents granted access to a locked object.
virtual void unlock()
Unlocks the mutex.
Data & get() const
Returns the protected data.
WSharedObjectTicketWrite(Data &data, std::shared_ptr< std::shared_mutex > mutex, std::shared_ptr< WCondition > condition)
Create a new instance.
virtual ~WSharedObjectTicketWrite()
Destroys the ticket and releases the lock.
std::unique_lock< std::shared_mutex > m_lock
The lock.
Class which represents granted access to a locked object.
Wrapper around an object/type for thread safe sharing of objects among multiple threads.