Mercurial > cpython-lru_cache-weakref
diff Python/thread_beos.h @ 21766:8b116a8449bd legacy-trunk
Remove the unused & broken PyThread_*_sema() functions and related constants.
This closes SF patch #504215.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Sat, 19 Jan 2002 22:02:55 +0000 |
| parents | c2150313d9d1 |
| children | e38335d4df91 df5719c298db |
line wrap: on
line diff
--- a/Python/thread_beos.h Sat Jan 19 10:41:51 2002 +0000 +++ b/Python/thread_beos.h Sat Jan 19 22:02:55 2002 +0000 @@ -285,73 +285,3 @@ return; } } - -/* ---------------------------------------------------------------------- - * Semaphore support. - * - * Guido says not to implement this because it's not used anywhere; - * I'll do it anyway, you never know when it might be handy, and it's - * easy... - */ -PyThread_type_sema PyThread_allocate_sema( int value ) -{ - sem_id sema; - - dprintf(("PyThread_allocate_sema called\n")); - - sema = create_sem( value, "python semaphore" ); - if( sema < B_NO_ERROR ) { - /* TODO: that's bad, raise an exception */ - return 0; - } - - dprintf(("PyThread_allocate_sema() -> %p\n", sema)); - return (PyThread_type_sema) sema; -} - -void PyThread_free_sema( PyThread_type_sema sema ) -{ - status_t retval; - - dprintf(("PyThread_free_sema(%p) called\n", sema)); - - retval = delete_sem( (sem_id)sema ); - if( retval != B_NO_ERROR ) { - /* TODO: that's bad, raise an exception */ - return; - } -} - -int PyThread_down_sema( PyThread_type_sema sema, int waitflag ) -{ - status_t retval; - - dprintf(("PyThread_down_sema(%p, %d) called\n", sema, waitflag)); - - if( waitflag ) { - retval = acquire_sem( (sem_id)sema ); - } else { - retval = acquire_sem_etc( (sem_id)sema, 1, B_TIMEOUT, 0 ); - } - - if( retval != B_NO_ERROR ) { - /* TODO: that's bad, raise an exception */ - return 0; - } - - dprintf(("PyThread_down_sema(%p) return\n", sema)); - return -1; -} - -void PyThread_up_sema( PyThread_type_sema sema ) -{ - status_t retval; - - dprintf(("PyThread_up_sema(%p)\n", sema)); - - retval = release_sem( (sem_id)sema ); - if( retval != B_NO_ERROR ) { - /* TODO: that's bad, raise an exception */ - return; - } -}
