]> mj.ucw.cz Git - libucw.git/commit
Use gettid() on Linux.
authorMartin Mares <mj@ucw.cz>
Mon, 18 Dec 2006 11:29:30 +0000 (12:29 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 18 Dec 2006 11:29:30 +0000 (12:29 +0100)
commita996044f96a0600122c4f208663ae79715868bbc
tree50e2f8cb4ee6584e24820ad981a3abdcf882968a
parentb5f9a4654516e0ec37373e198e6b3a6f6a2a186d
Use gettid() on Linux.

This is a hack for two reasons:

  o  Current glibc releases (up to 2.5) have no wrapper for gettid(),
     so we have to use _syscall0 to access it.
  o  There is no guarantee that pthreads will correspond to kernel
     threads. However, in the two existing implementations of pthreads
     on Linux, they correspond either to kernel processes or kernel
     threads, so assumptions that the (pid, tid) pair is unique are
     correct.

On the other hand, using real thread ID's has many advantages,
so I am keeping this patch at least in the dev-sorter branch to see
if it's safe or not.
lib/threads.c