Symbian
Symbian OS Library

FAQ-0520 How do I find out about the current thread or process?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Base
Created: 09/12/2000 Modified: 09/11/2002
Number: FAQ-0520
Platform: Not Applicable

Question:
How do I find out about the current thread or process?

Answer:
As the SDK says:
RThread() - Default C++ constructor

If xxx() is a member function of RThread, then a useful technique for calling this function on the current thread is simply to call:

RThread().xxx();

For example, the current thread's id can be found with:

RThread().Id(); // compiler creates an unnamed temporary RThread object.

or:

RThread currentThread(); // we name the object ourselves if we plan to make lots of calls.
currentThread.Id();

Substitute RProcess for RThread if you want the current process instead of the current thread.