diff Python/thread_nt.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 8d5c000e0e5b
children 7a3e03b541ff
line wrap: on
line diff
--- a/Python/thread_nt.h	Sat Jan 19 10:41:51 2002 +0000
+++ b/Python/thread_nt.h	Sat Jan 19 22:02:55 2002 +0000
@@ -319,56 +319,3 @@
 	if (!(aLock && LeaveNonRecursiveMutex((PNRMUTEX) aLock)))
 		dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n", PyThread_get_thread_ident(), aLock, GetLastError()));
 }
-
-/*
- * Semaphore support.
- */
-PyThread_type_sema PyThread_allocate_sema(int value)
-{
-	HANDLE aSemaphore;
-
-	dprintf(("%ld: PyThread_allocate_sema called\n", PyThread_get_thread_ident()));
-	if (!initialized)
-		PyThread_init_thread();
-
-	aSemaphore = CreateSemaphore( NULL,           /* Security attributes          */
-	                              value,          /* Initial value                */
-	                              INT_MAX,        /* Maximum value                */
-	                              NULL);          /* Name of semaphore            */
-
-	dprintf(("%ld: PyThread_allocate_sema() -> %p\n", PyThread_get_thread_ident(), aSemaphore));
-
-	return (PyThread_type_sema) aSemaphore;
-}
-
-void PyThread_free_sema(PyThread_type_sema aSemaphore)
-{
-	dprintf(("%ld: PyThread_free_sema(%p) called\n", PyThread_get_thread_ident(), aSemaphore));
-
-	CloseHandle((HANDLE) aSemaphore);
-}
-
-/*
-  XXX must do something about waitflag
- */
-int PyThread_down_sema(PyThread_type_sema aSemaphore, int waitflag)
-{
-	DWORD waitResult;
-
-	dprintf(("%ld: PyThread_down_sema(%p) called\n", PyThread_get_thread_ident(), aSemaphore));
-
-	waitResult = WaitForSingleObject( (HANDLE) aSemaphore, INFINITE);
-
-	dprintf(("%ld: PyThread_down_sema(%p) return: %l\n", PyThread_get_thread_ident(), aSemaphore, waitResult));
-	return 0;
-}
-
-void PyThread_up_sema(PyThread_type_sema aSemaphore)
-{
-	ReleaseSemaphore(
-                (HANDLE) aSemaphore,            /* Handle of semaphore                          */
-                1,                              /* increment count by one                       */
-                NULL);                          /* not interested in previous count             */
-                                                
-	dprintf(("%ld: PyThread_up_sema(%p)\n", PyThread_get_thread_ident(), aSemaphore));
-}