From 3118cea037b63661e5f7ebff0c1a810da7f6159b Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 6 Dec 2005 21:54:32 +0000 Subject: fixes for pthreads version 2 fixes for pthreads V2 svn path=/trunk/; revision=4156 --- externals/grill/py/source/pybase.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'externals/grill/py/source') diff --git a/externals/grill/py/source/pybase.cpp b/externals/grill/py/source/pybase.cpp index e68d9929..bdc76099 100644 --- a/externals/grill/py/source/pybase.cpp +++ b/externals/grill/py/source/pybase.cpp @@ -27,7 +27,19 @@ static PyObject *gcollect = NULL; #ifdef FLEXT_THREADS -typedef std::map PyThrMap; +class ThrCmp +{ +public: + inline bool operator()(const flext::thrid_t &a,const flext::thrid_t &b) const + { + if(sizeof(a) == sizeof(size_t)) + return *(size_t *)&a < *(size_t *)&b; + else + return memcmp(&a,&b,sizeof(a)) < 0; + } +}; + +typedef std::map PyThrMap; static PyInterpreterState *pymain = NULL; static PyThrMap pythrmap; -- cgit v1.2.1