]> granicus.if.org Git - libevent/commit
Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long)
authorNick Mathewson <nickm@torproject.org>
Tue, 26 Oct 2010 16:09:20 +0000 (12:09 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 26 Oct 2010 16:09:20 +0000 (12:09 -0400)
commitfbaf0770a709aaf7ed50914e26ea3d5a350e189d
tree203eeff987e6492c07baf402f3fb404ed178fa01
parentac1931ac3d3ed4977c95f3aedf047e7c3adedc7f
Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long)

When pthread_t was smaller, our calculated thread IDs would include
uninitialized RAM, and so our unit tests would fail because thread_ids
would never match one another.

When pthread_t was larger and alignment was big-endian, our calculated
thread IDs would only have the most significant bytes of the
pthread_t, when in practice all the entropy is in the low-order bytes.

Found with help from Dagobert Michelsen.
configure.in
evthread_pthread.c