|
RE: API for unique thread-id in QNX
|
06/01/2015 8:17 AM
post113882
|
RE: API for unique thread-id in QNX
You could use a pthread key and store the value of a global counter which you could use as a unique id?
|
|
|
|
RE: API for unique thread-id in QNX
|
06/01/2015 12:10 PM
post113889
|
RE: API for unique thread-id in QNX
If this is related to the MIB3 logging requirements the closest we have is maybe to use.
volatile struct _thread_local_storage *tls = LIBC_TLS();
tls->__owner
which will give you a system wide unique id, but only for that instance, if processes or thread ends it can be reused.
But then again you have the same issue for gettid.
So if you want runtime unique you'll need a custom solution for both linux and qnx, with a value larger than 32bit.
-----Original Message-----
From: Mayank Jain [mailto:community-noreply@qnx.com]
Sent: Montag, 1. Juni 2015 14:14
To: general-toolchain
Subject: API for unique thread-id in QNX
Is there any API to obtain *unique* thread-id at least at the process level (if not across processes) in the QNX? Like
Linux and Android support gettid API/syscall which returns unique thread-id. Any help is highly appreciated.
Please note Id obtained by pthread_self() may be reused after a terminated thread has been joined, or a detached thread
has terminated.
_______________________________________________
General
http://community.qnx.com/sf/go/post113881
To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com
|
|
|