ACE_TSS_Guard(3)

ACE_TSS_Guard3

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!

Usage

#include <ace/Synch_T.h>
template<class ACE_LOCK>
class ACE_TSS_Guard
{
  public:
    ACE_TSS_Guard (ACE_LOCK &lock, int block = 1);
    ~ACE_TSS_Guard (void);
    int acquire (void);
    int tryacquire (void);
    int release (void);
    int remove (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 ACE_UNIMPLEMENTED_FUNC (
        void operator= (const ACE_TSS_Guard<ACE_LOCK> &)
        );
};

Initialization and termination methods.

ACE_TSS_Guard (ACE_LOCK &lock, int block = 1);

Implicitly and automatically acquire the thread-specific lock.

~ACE_TSS_Guard (void);

Implicitly release the thread-specific lock.

Lock accessors.

int acquire (void);

Explicitly acquire the thread-specific lock.

int tryacquire (void);

Conditionally acquire the thread-specific lock (i.e., won't block).

int release (void);

Explicitly release the thread-specific lock.

Utility methods.

int remove (void);

Explicitly release the thread-specific lock.

void dump (void) const;

Dump the state of an object.

ACE_ALLOC_HOOK_DECLARE; Declare the dynamic allocation hooks.

Prevent assignment and initialization.

inline ACE_UNIMPLEMENTED_FUNC (
    void operator= (const ACE_TSS_Guard<ACE_LOCK> &)
    );

Library

ace

Author

Doug Schmidt

From libace-doc 5.0.7-4 in Debian 2.2 (Potato). Parsed by carta from the page's man source.