ACE_Thread_Exit(3)

ACE_Thread_Exit3

Keep exit information for a thread in thread specific storage. so that the thread-specific exit hooks will get called no matter how the thread exits (e.g., via ace_thread::exit, c++ or win32 exception, "falling off the end" of the thread entry point function, etc.).

Usage

#include <ace/OS.h>
class ACE_Thread_Exit
{
  public:
    ACE_Thread_Exit (void);
    void thr_mgr (ACE_Thread_Manager *tm);
    void *status (void *s);
    void *status (void);
    ~ACE_Thread_Exit (void);
    static ACE_Thread_Exit *instance (void);
    static void cleanup (void *instance, void *);
  private:
    void *status_;
    ACE_Thread_Control thread_control_;
};

Overview

This clever little helper class is stored in thread-specific storage using the ACE_TSS wrapper. When a thread exits the ACE_TSS::cleanup function deletes this object, thereby closing it down gracefully.

Public members

ACE_Thread_Exit (void);

Capture the Thread that will be cleaned up automatically.

void thr_mgr (ACE_Thread_Manager *tm);

Set the ACE_Thread_Manager.

void *status (void *s);

Set the exit status.

void *status (void);

Get the exit status.

~ACE_Thread_Exit (void);

Destructor calls the thread-specific exit hooks when a thread exits.

static ACE_Thread_Exit *instance (void);

Singleton access point.

static void cleanup (void *instance, void *);

Cleanup method, used by the ACE_Object_Manager to destroy the singleton.

Private members

void *status_;

Exit status...

ACE_Thread_Control thread_control_;

Automatically add/remove the thread from the ACE_Thread_Manager.

The ACE_Sched_Priority type should be used for platform-

independent thread and process priorities, by convention. int should be used for OS-specific priorities.

typedef for the _stat data structure

Giving unique ACE scoped names for some important

RTSignal-Related constants. Becuase sometimes, different platforms use different names for these constants.

Library

ace

Author

Doug Schmidt [email protected], Jesper S. M|ller [email protected], and a cast of thousands...

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