#include <string>
#include <iostream>
#include <dvthread/monitor.h>
#include <dvthread/thread.h>
Include dependency graph for lock.h:
Go to the source code of this file.
Namespaces | |
namespace | Dv |
namespace | Dv::Thread |
Classes | |
class | Dv::Thread::Lock |
Convenience class to synchronize access to a Monitor object. More... | |
Defines | |
#define | SYNCHRONIZED Dv::Thread::Lock lock(*this); |
Convenience macro. |
|
Convenience macro. Put this in the beginning of a member function of a subclass of a Monitor object to ensure exclusive access to some resource. Inspired by Java keyword. class Buffer: public Dv::Thread::Monitor { public: int get() { SYNCHRONIZED retrieve & remove item; } void put(int) { SYNCHRONIZED add item; } }; |
dvthread-0.5.0 | [22 June, 2006] |