diff --git a/src/backend/pyloader/ScriptAdapter.py b/src/backend/pyloader/ScriptAdapter.py index d6a66d5..2100da7 100644 --- a/src/backend/pyloader/ScriptAdapter.py +++ b/src/backend/pyloader/ScriptAdapter.py @@ -79,7 +79,7 @@ class ScriptAdapter : # # @param self The caller object def async_is_preemptive(self): - _g_mutex.lock(ScriptAdapter._wrap_is_preemptive, self) + self._g_mutex.lock(ScriptAdapter._wrap_is_preemptive, self) def _wrap_is_preemptive(self): thread.start_new_thread(ScriptAdapter._wrap_is_preemptive_callback, (self,)) @@ -105,5 +105,5 @@ class ScriptAdapter : def get_return_value(self): return self._ret_val - def test_lock(self): + def mutex_test_lock(self): return self._g_mutex.test() diff --git a/src/backend/pyloader/python_policy.cc b/src/backend/pyloader/python_policy.cc index 4d412d4..2697413 100644 --- a/src/backend/pyloader/python_policy.cc +++ b/src/backend/pyloader/python_policy.cc @@ -131,6 +131,7 @@ PythonPolicy::is_pre_emptive() const throw(UserInterruptException) // Parse return value stored in global Python object retval = PyObject_CallMethod(_adapter, "get_return_value", NULL); + assert(retval); bool ret = PyObject_IsTrue(retval); Py_DECREF(retval); return ret; @@ -146,6 +147,7 @@ PythonPolicy::get_time_slice() const throw(UserInterruptException) { // Parse return value stored in global Python object retval = PyObject_CallMethod(_adapter, "get_return_value", NULL); + assert(retval); long tmp = PyInt_AsLong(retval); Py_DECREF(retval); @@ -167,7 +169,7 @@ PythonPolicy::wait_unlock() const throw(UserInterruptException) usleep(WAIT_FOR); // hack'a'ton! magggggiccc nummmbeeerrrrrs!! Py_BLOCK_THREADS; - PyObject* retval = PyObject_CallMethod(_adapter, "test_lock", NULL); + PyObject* retval = PyObject_CallMethod(_adapter, "mutex_test_lock", NULL); assert(retval); still_locked = PyObject_IsTrue(retval); Py_DECREF(retval);