diff --git a/python_config/condvar.h b/python_config/condvar.h index d3ea5f7..e876cb6 100644 --- a/python_config/condvar.h +++ b/python_config/condvar.h @@ -150,14 +150,14 @@ PyMUTEX_UNLOCK(PyMUTEX_T *mut) { Py_LOCAL_INLINE(int) PyCOND_INIT(PyCOND_T *cond, PyMUTEX_T *mut) { - condvarInit(cond, mut); + condvarInit(cond); return 0; } #define PyCOND_FINI(cond) 0 #define PyCOND_SIGNAL(cond) condvarWakeOne((cond)) #define PyCOND_BROADCAST(cond) condvarWakeAll((cond)) -#define PyCOND_WAIT(cond, mut) condvarWait((cond)) +#define PyCOND_WAIT(cond, mut) condvarWait((cond),mut) /* return 0 for success, 1 on timeout, -1 on error */ Py_LOCAL_INLINE(int) @@ -166,7 +166,7 @@ PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, PY_LONG_LONG us) int r; u64 ns = us * 1000; // microseconds to nanoseconds - r = condvarWaitTimeout((cond), ns); + r = condvarWaitTimeout((cond),mut, ns); if (r == 0xEA01) return 1; else if (r) diff --git a/python_config/thread_nx.h b/python_config/thread_nx.h index 04ff8b7..53a814c 100644 --- a/python_config/thread_nx.h +++ b/python_config/thread_nx.h @@ -139,7 +139,7 @@ PyThread_allocate_lock(void) mutexInit(&(lock->mutex)); - condvarInit(&(lock->cv), &(lock->mutex)); + condvarInit(&(lock->cv)); dprintf(("PyThread_allocate_lock() -> %p\n", lock)); return (PyThread_type_lock) lock; @@ -193,12 +193,12 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds, success = PY_LOCK_FAILURE; while (success == PY_LOCK_FAILURE) { if (microseconds > 0) { - status = condvarWaitTimeout(&(thelock->cv), ns); + status = condvarWaitTimeout(&(thelock->cv),&(thelock->mutex), ns); if (status == 0xEA01) // on timeout break; } else { - status = condvarWait(&(thelock->cv)); + status = condvarWait(&(thelock->cv),&(thelock->mutex)); } if (intr_flag && status == 0 && thelock->locked) {