pr_getcurrentthread.rst (563B)
1 PR_GetCurrentThread 2 =================== 3 4 Returns the current thread object for the currently running code. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prthread.h> 13 14 PRThread* PR_GetCurrentThread(void); 15 16 17 Returns 18 ~~~~~~~ 19 20 Always returns a valid reference to the calling thread--a self-identity. 21 22 23 Description 24 ~~~~~~~~~~~ 25 26 The currently running thread may discover its own identity by calling 27 :ref:`PR_GetCurrentThread`. 28 29 .. note:: 30 31 This is the only safe way to establish the identity of a 32 thread. Creation and enumeration are both subject to race conditions.