This is the mail archive of the
mailing list for the pthreas-win32 project.
pthread_t and stl maps
- From: "Tobias Ljunggren" <jtl at myrealbox dot com>
- To: pthreads-win32 at sourceware dot org
- Date: Tue, 31 Mar 2009 11:51:45 +0200
- Subject: pthread_t and stl maps
I've been using pthreads-win32 (rel 2.7.0) for some time but recently changed to current head in CVS due to win64 support.
First of all I must say that the upgrade from 2.7.0 was easier than I thought. A good work to all of you who are involved with the development!
I use the same code base for both Linux and Windows builds and it works great.
I use a stl map to store some static data that are shared within the same thread but not by other threads. The change of pthread_t to a struct requires a sort function if the key in a map is a thread identifier (pthread_t).
What should the correct ordering be? I looked at the code in pthread_equal and guess that "(left.p < right.p)" isn't enough but is (left.p < right.p && left.x < right.x) ok?