Ivan Pozdeev <ivan_pozd...@mail.ru> added the comment:

In all PyMUTEX_* and most PyCOND_* functions, all the underlying APIs are void. 
So there's no point for the functions to return anything other than as 
convention.

A comment at the start of condvar.h says: "APIs generally return 0 on success 
and non-zero on error".
In Python\ceval_gil.h:57, there are boilerplace checker macros for them
(which will never fire).

So I guess this is done for uniformity.
Regardless, PyMUTEX_UNLOCK and PyMUTEX_LOCK at least are called both with and 
without checking the return value.


So I would drop the pretense and make these fns void.

---

That said, the reported error still persists after the fix.
The code confusing about which value LeaveNonRecursiveMutex should return on 
success. Pushed another commit, confirmed to work now.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33316>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to