aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/pybase.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-12-06 21:54:32 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-12-06 21:54:32 +0000
commit3118cea037b63661e5f7ebff0c1a810da7f6159b (patch)
tree87acee46f072dcf73f0dda6bcbfe6627e7be1b51 /externals/grill/py/source/pybase.cpp
parentf25cb430026b01219984364bb991948418909b77 (diff)
fixes for pthreads version 2
fixes for pthreads V2 svn path=/trunk/; revision=4156
Diffstat (limited to 'externals/grill/py/source/pybase.cpp')
-rw-r--r--externals/grill/py/source/pybase.cpp14
1 files changed, 13 insertions, 1 deletions
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<flext::thrid_t,PyThreadState *> 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<flext::thrid_t,PyThreadState *,ThrCmp> PyThrMap;
static PyInterpreterState *pymain = NULL;
static PyThrMap pythrmap;