Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python_config/condvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions python_config/thread_nx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down