Each thread and process is allocated an ID which is unique across all threads and processes.
The ID is allocated when the thread or process is created. The main motivation for the ID is to provide assistance for debuggers; it provides an easy way to identify threads and processes.
In general, applications and servers can use IDs for thread and process identification or, indeed, for whatever purpose that suits them.
While a thread ID is a property of the thread, it can be retrieved from the thread by calling RThread::Id() . The ID is encapsulated by a TThreadId object that is returned by the function.
The TThreadId class provides == and != operators for comparing two thread IDs.
The process ID is similar; it can be retrieved from the process by calling RProcess::Id() , and is encapsulated by a TProcessId object returned by the function.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License v1.0.