[strongSwan-dev] [PATCH 8/8] Use thread id as retrieved by gettid in log messages

Tobias Brunner 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 [1]):

  "[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).

Regards,
Tobias

[1] http://git.strongswan.org/?p=strongswan.git;a=commitdiff;h=c17f6f96




More information about the Dev mailing list