You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
500 B

#ifndef MT_SCOPED_WRITE_LOCK_H
#define MT_SCOPED_WRITE_LOCK_H
#include "rw_lock.h"
namespace mt
{
class scoped_write_lock
{
MT_PREVENT_COPY(scoped_write_lock)
public:
typedef scoped_write_lock this_type;
typedef void base_type;
scoped_write_lock(rw_lock & rwl) : rw(rwl)
{
this->rw.lock_write();
}
~scoped_write_lock(void)
{
this->rw.unlock_write();
}
protected:
rw_lock & rw;
};
}
#endif // MT_SCOPED_WRITE_LOCK_H