|
static int | spawn (ACE_THR_FUNC func, void *arg=0, long flags=THR_NEW_LWP|THR_JOINABLE, ACE_thread_t *t_id=0, ACE_hthread_t *t_handle=0, long priority=ACE_DEFAULT_THREAD_PRIORITY, void *stack=0, size_t stack_size=ACE_DEFAULT_THREAD_STACKSIZE, ACE_Thread_Adapter *thread_adapter=0, const char **thr_name=0) |
|
static size_t | spawn_n (size_t n, ACE_THR_FUNC func, void *arg=0, long flags=THR_NEW_LWP|THR_JOINABLE, long priority=ACE_DEFAULT_THREAD_PRIORITY, void *stack[]=0, size_t stack_size[]=0, ACE_Thread_Adapter *thread_adapter=0, const char *thr_name[]=0) |
|
static size_t | spawn_n (ACE_thread_t thread_ids[], size_t n, ACE_THR_FUNC func, void *arg, long flags, long priority=ACE_DEFAULT_THREAD_PRIORITY, void *stack[]=0, size_t stack_size[]=0, ACE_hthread_t thread_handles[]=0, ACE_Thread_Adapter *thread_adapter=0, const char *thr_name[]=0) |
|
static int | join (ACE_thread_t thread_id, ACE_thread_t *departed, ACE_THR_FUNC_RETURN *status) |
|
static int | join (ACE_hthread_t, ACE_THR_FUNC_RETURN *=0) |
| Wait for one thread to exit and reap its exit status. More...
|
|
static int | resume (ACE_hthread_t) |
| Continue the execution of a previously suspended thread. More...
|
|
static int | suspend (ACE_hthread_t) |
| Suspend the execution of a particular thread. More...
|
|
static int | getprio (ACE_hthread_t ht_id, int &priority) |
| Get the priority of a particular thread. More...
|
|
static int | getprio (ACE_hthread_t ht_id, int &priority, int &policy) |
| Get the priority and policy of a particular thread. More...
|
|
static int | setprio (ACE_hthread_t ht_id, int priority, int policy=-1) |
| Set the priority of a particular thread. More...
|
|
static int | kill (ACE_thread_t, int signum) |
| Send a signal to the thread. More...
|
|
static void | yield (void) |
| Yield the thread to another. More...
|
|
static void | self (ACE_hthread_t &t_handle) |
|
static ACE_thread_t | self (void) |
| Return the unique ID of the thread. More...
|
|
static void | exit (ACE_THR_FUNC_RETURN status=0) |
|
static int | getconcurrency (void) |
| Get the LWP concurrency level of the process. More...
|
|
static int | setconcurrency (int new_level) |
| Set the LWP concurrency level of the process. More...
|
|
static int | sigsetmask (int how, const sigset_t *sigset, sigset_t *osigset=0) |
| Change and/or examine calling thread's signal mask. More...
|
|
static int | keycreate (ACE_thread_key_t *keyp, ACE_THR_DEST destructor) |
|
static int | keyfree (ACE_thread_key_t key) |
| Free up the key so that other threads can reuse it. More...
|
|
static int | setspecific (ACE_thread_key_t key, void *value) |
|
static int | getspecific (ACE_thread_key_t key, void **valuep) |
|
static int | disablecancel (struct cancel_state *old_state) |
| Disable thread cancellation. More...
|
|
static int | enablecancel (struct cancel_state *old_state, int flag) |
| Enable thread cancellation. More...
|
|
static int | setcancelstate (struct cancel_state &new_state, struct cancel_state *old_state) |
| Set the cancellation state. More...
|
|
static int | cancel (ACE_thread_t t_id) |
|
static void | testcancel (void) |
| Test the cancel. More...
|
|
Provides a wrapper for threads.
This class provides a common interface that is mapped onto POSIX Pthreads, Solaris threads, Win32 threads, VxWorks threads, or pSoS threads. Note, however, that it is generally a better idea to use the ACE_Thread_Manager programming API rather than the <ACE_Thread> API since the thread manager is more powerful.
Creates a new thread having flags attributes and running func with args (if thread_adapter is non-0 then func and args are ignored and are obtained from thread_adapter>. thr_id and t_handle are set to the thread's ID and handle (?), respectively. The thread runs at priority priority (see below).
The flags are a bitwise-OR of the following: = BEGIN<INDENT> THR_CANCEL_DISABLE, THR_CANCEL_ENABLE, THR_CANCEL_DEFERRED, THR_CANCEL_ASYNCHRONOUS, THR_BOUND, THR_NEW_LWP, THR_DETACHED, THR_SUSPENDED, THR_DAEMON, THR_JOINABLE, THR_SCHED_FIFO, THR_SCHED_RR, THR_SCHED_DEFAULT, THR_EXPLICIT_SCHED, THR_SCOPE_SYSTEM, THR_SCOPE_PROCESS = END<INDENT>
By default, or if priority is set to ACE_DEFAULT_THREAD_PRIORITY, an "appropriate" priority value for the given scheduling policy (specified in flags, e.g., THR_SCHED_DEFAULT
is used. This value is calculated dynamically, and is the median value between the minimum and maximum priority values for the given policy. If an explicit value is given, it is used. Note that actual priority values are EXTREMELY implementation-dependent, and are probably best avoided.
Note that thread_adapter is always deleted when spawn is called, so it must be allocated with global operator new.