Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWThreadId

Module:  Threads   Package:  Synchronization


Does not inherit

Local Index

Members

Non-Members

Header File

#include <rw/sync/RWThreadId.h> 

Description

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, that is associated with the current thread of execution. The rwThreadHash() function should be used to retrieve a unique integer value associated with a thread id for output or debugging purposes. You should 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.

Example

Global Typedefs

typedef unsigned  RWThreadIdRep;   // Single-Threaded
typedef pthread_t RWThreadIdRep;   // POSIX
typedef thread_t  RWThreadIdRep;   // SOLARIS
typedef unsigned  RWThreadIdRep;   // Win32 with Microsoft

Static Member Functions

static bool
isSelf(const RWThreadId& id);
static RWThreadId
self();

Public Constructors

RWThreadId();
RWThreadId(const RWThreadIdRep& threadId);

Public Destructor

~RWThreadId();

Public Member Operators

RWThreadId&
operator=(const RWThreadId& second);
bool
operator==(const RWThreadId& second) const;
bool
operator!=(const RWThreadId& second) const;
operator 
RWThreadIdRep&() const;

Public Member Functions

void
clear();
RWThreadIdRep*
getRep() const;
unsigned
hash() const;
bool
isValid() const;

See Also

rwThreadId(), rwThreadHash(), rwThread(), RWRunnableHandle



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.