NAME
ACE_TSS_Guard -
This data structure is meant to be used within a method or
function... It performs automatic aquisition and release of
a synchronization object. Moreover, it ensures that the lock
is released even if a thread exits via "thr_exit()"!
SYNOPSIS
#include <ace/Synch_T.h>
template<class LOCK>
class ACE_TSS_Guard
{
public:
ACE_TSS_Guard (LOCK &lock, int block = 1);
~ACE_TSS_Guard (void);
int remove (void);
int acquire (void);
int tryacquire (void);
int release (void);
void dump (void) const;
protected:
ACE_TSS_Guard (void);
void init_key (void);
static void cleanup (void *ptr);
ACE_thread_key_t key_;
private:
inline void operator= (const ACE_TSS_Guard<LOCK> &);
inline ACE_TSS_Guard (const ACE_TSS_Guard<LOCK> &);
};
Prevent assignment and initialization.
inline void operator= (const ACE_TSS_Guard<LOCK> &);
inline ACE_TSS_Guard (const ACE_TSS_Guard<LOCK> &);
AUTHOR
Doug Schmidt
LIBRARY
ace