Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r54877:ff98315fab0d
Date: 2012-04-30 17:30 -0700
http://bitbucket.org/pypy/pypy/changeset/ff98315fab0d/

Log:    prevent a class of CINT-specific race conditions

diff --git a/pypy/module/cppyy/src/cintcwrapper.cxx 
b/pypy/module/cppyy/src/cintcwrapper.cxx
--- a/pypy/module/cppyy/src/cintcwrapper.cxx
+++ b/pypy/module/cppyy/src/cintcwrapper.cxx
@@ -36,6 +36,10 @@
 extern "C" void G__LockCriticalSection();
 extern "C" void G__UnlockCriticalSection();
 
+#define G__SETMEMFUNCENV      (long)0x7fff0035
+#define G__NOP                (long)0x7fff00ff
+
+
 /* ROOT meta internals ---------------------------------------------------- */
 namespace {
 
@@ -84,7 +88,7 @@
 static GlobalVars_t g_globalvars;
 
 
-/* initialization of th ROOT system (debatable ... ) ---------------------- */
+/* initialization of the ROOT system (debatable ... ) --------------------- */
 namespace {
 
 class TCppyyApplication : public TApplication {
@@ -288,7 +292,9 @@
     G__setnull(&result);
 
     G__LockCriticalSection();      // is recursive lock
-
+    long index = (long)&method;
+    G__CurrentCall(G__SETMEMFUNCENV, 0, &index);
+    
     // TODO: access to store_struct_offset won't work on Windows
     long store_struct_offset = G__store_struct_offset;
     if (self)
@@ -302,6 +308,7 @@
     if (G__get_return(0) > G__RETURN_NORMAL)
         G__security_recover(0);    // 0 ensures silence
 
+    G__CurrentCall(G__NOP, 0, 0);
     G__UnlockCriticalSection();
 
     return result;
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to