ACE 8.0.0
|
Provides a wrapper for threads. More...
#include <Thread.h>
Private Member Functions | |
ACE_Thread () | |
Ensure that we don't get instantiated. | |
Provides a wrapper for threads.
This class provides a common interface that is mapped onto POSIX Pthreads, 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.
|
private |
Ensure that we don't get instantiated.
|
inlinestatic |
Cancel a thread.
|
inlinestatic |
Disable thread cancellation.
|
inlinestatic |
Enable thread cancellation.
|
inlinestatic |
Exit the current thread and return "status". Should not be called by main thread.
|
inlinestatic |
Get the LWP concurrency level of the process.
|
inlinestatic |
Get the priority of a particular thread.
|
inlinestatic |
Get the priority and policy of a particular thread.
|
inlinestatic |
Stores the current value bound to key for the calling thread into the location pointed to by valuep.
Stores the current value bound to key> for the calling thread into the location pointed to by valuep.
|
inlinestatic |
Wait for one thread to exit and reap its exit status.
|
inlinestatic |
Wait for one or more threads to exit and reap their exit status. thr_join() returns successfully when the target thread terminates.
thread_id | is the ACE_thread_t ID of the thread to wait for. If thread_id is 0, join() waits for any undetached thread in the process to terminate on platforms that support this capability |
departed | points to a location that is set to the ID of the terminated thread if join() returns successfully. If departed is 0, it is ignored. |
status | Points to the location that receives the joined thread's exit value. If status is 0, it is ignored. |
0 | for success |
-1 | (with errno set) for failure. |
|
inlinestatic |
Allocates a keyp that is used to identify data that is specific to each thread in the process. The key is global to all threads in the process.
|
inlinestatic |
Free up the key so that other threads can reuse it.
|
inlinestatic |
Send a signal to the thread.
|
inlinestatic |
Continue the execution of a previously suspended thread.
|
inlinestatic |
Return the unique ID of the thread.
|
inlinestatic |
Return the unique kernel handle of the thread. Note that on Win32 this is actually a pseudohandle, which cannot be shared with other processes or waited on by threads. To locate the real handle, please use the ACE_Thread_Manager::thr_self() method.
|
inlinestatic |
Set the cancellation state.
Set the LWP concurrency level of the process.
|
inlinestatic |
Set the priority of a particular thread.
|
inlinestatic |
Bind value to the thread-specific data key, key, for the calling thread.
|
inlinestatic |
Change and/or examine calling thread's signal mask.
|
inlinestatic |
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.
|
static |
Spawn n new threads, which execute func with argument arg (if thread_adapter is non-0 then func and args are ignored and are obtained from thread_adapter). The thread_ids of successfully spawned threads will be placed into the thread_ids buffer (which must be the same size as n). If stack != 0 it is assumed to be an array of n pointers to the base of the stacks to use for the threads being spawned. If stack_size != 0 it is assumed to be an array of n values indicating how big each of the corresponding stacks are. If thread_handles != 0 it is assumed to be an array of n thread_handles that will be assigned the values of the thread handles being spawned. Returns the number of threads actually spawned (if this doesn't equal the number requested then something has gone wrong and errno
will explain...).
|
static |
Spawn N new threads, which execute func with argument arg (if thread_adapter is non-0 then func and args are ignored and are obtained from thread_adapter). If stack != 0 it is assumed to be an array of n pointers to the base of the stacks to use for the threads being spawned. Likewise, if stack_size != 0 it is assumed to be an array of n values indicating how big each of the corresponding stacks are. Returns the number of threads actually spawned (if this doesn't equal the number requested then something has gone wrong and errno
will explain...).
|
inlinestatic |
Suspend the execution of a particular thread.
|
inlinestatic |
Test the cancel.
|
inlinestatic |
Yield the thread to another.