diff options
Diffstat (limited to 'externals/grill/py/source')
-rw-r--r-- | externals/grill/py/source/pybase.cpp | 14 |
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;
|