[Python-Dev] thread_foobar.h routines

Guido van Rossum guido@python.org
Tue, 15 Jan 2002 22:33:08 -0500


> I'm writing thread routines for the Plan 9 port of Python.
> 
> Is it correct that:
> 
> 	PyThread_acquire_lock returns 1 on success, 0 on failure.
> 	PyThread_down_sema returns 0 on success, -1 on failure.
> 
> It appears that way, but the inconsistency bothers me.

Me too.  The PyThread_*_sema routines are not used, and I would
recommend that you not bother implementing them at all.  (If anyone
used them, we would have heard a complaint -- in some thread
implementations these return -1 for failure, in others 0.  :-)

We should cut these out of the sources.

--Guido van Rossum (home page: http://www.python.org/~guido/)