SourcePro® 2024.1 |
SourcePro® API Reference Guide |
A wrapper for platform-specific thread IDs. More...
#include <rw/sync/RWThreadId.h>
Public Member Functions | |
RWThreadId () | |
RWThreadId (const RWThreadId &second) | |
RWThreadId (const RWThreadIdRep &threadIdRep) | |
RWThreadId (RWStaticCtor) | |
~RWThreadId () | |
void | clear () |
RWThreadIdRep * | getRep () const |
unsigned | hash () const |
bool | isValid () const |
operator RWThreadIdRep & () const | |
bool | operator!= (const RWThreadId &second) const |
RWThreadId & | operator= (const RWThreadId &second) |
bool | operator== (const RWThreadId &second) const |
Static Public Member Functions | |
static bool | isSelf (const RWThreadId &id) |
static RWThreadId | self () |
Related Symbols | |
(Note that these are not member symbols.) | |
unsigned | rwThreadHash (const RWThreadId &id) |
RWThreadId | rwThreadId () |
typedef pthread_t | RWThreadIdRep |
typedef thread_t | RWThreadIdRep |
typedef unsigned | RWThreadIdRep |
RWThreadId is a wrapper for platform-specific thread IDs. An RWThreadId represents the identification given by the underlying thread API to a specific thread of execution. The native thread IDs are used to identify and control these threads in the native thread API, but are not necessarily related to any Threads Module objects. You can get an instance of RWThreadId directly from a runnable object using the RWRunnableHandle::threadId() member function, or you can call the global function rwThreadId() to get an RWThreadId associated with the current thread. A thread ID is valid only while the separate thread of execution exists.
The global rwThread() function may be used to determine the threaded runnable object, if any, associated with the current thread of execution. Use the rwThreadHash() function to retrieve an integer associated with a thread id for output or debugging purposes. Do not attempt to stream an RWThreadId instance directly, as the native thread ID type that this class represents may be a structure and not a simple scalar.
OUTPUT:
|
inline |
Creates an RWThreadId object not associated with any thread.
|
inline |
Constructs a static instance, but does no direct initialization. Static instances are zero initialized, resulting in an RWThreadId with an invalid state.
|
inline |
Creates an RWThreadId object directly from a native thread ID.
|
inline |
Copy constructor.
|
inline |
Destructor.
|
inline |
Clears the native thread ID so it won't match other native IDs.
|
inline |
Returns the address of the native thread ID member.
|
inline |
Returns a hash of the thread ID.
|
inlinestatic |
Returns true
if id matches the thread ID of the currently running thread; otherwise, returns false
.
|
inline |
Returns true
if this thread ID was constructed or assigned from a native thread instance, otherwise false
.
|
inline |
Returns a reference to the native thread ID.
|
inline |
Compares native thread IDs for inequality.
|
inline |
Assignment operator.
|
inline |
Compares native thread IDs for equality.
|
inlinestatic |
Returns an RWThreadId for the current thread.
|
related |
Use this function when an integer is required to identify a particular thread for hashing and trace/debug output purposes. The thread id value stored inside an RWThreadId instance should not be used directly, since some environments use a structure to represent a thread id.
|
related |
The rwThreadId() function returns an RWThreadId instance containing the thread id value associated with the calling thread. This id value is assigned by the underlying threads system. You may query for the thread id of any thread, regardless of its method of creation.
|
related |
The internal thread id representation.
|
related |
The internal thread id representation.
|
related |
The internal thread id representation.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |