[strongSwan-dev] [PATCH 8/8] Use thread id as retrieved by gettid in log messages
tobias at strongswan.org
Fri Dec 16 17:16:27 CET 2011
> I would prefer a statement mapping the actual long thread ID
> to our shortened ID when the thread is being created.
Ok, thread IDs are now logged with DBG2 like this (see ):
"[LIB] created thread <num> [<tid>]"
Where <num> is the human-readable thread number and <tid> is either the
result of gettid() or, if not available, pthread_self(). Logging the
latter is not 100% portable, but most implementations seem to typedef
pthread_t as pointer or an integer so casting this to u_long should be
fine (we can add more variants later if required).
More information about the Dev