diff options
author | 2021-09-25 01:14:09 +0200 | |
---|---|---|
committer | 2021-09-25 01:14:09 +0200 | |
commit | 6bc89116cb121c176453b9745e3daa2cc5df43ab (patch) | |
tree | 2cc90cc3afaf2ad40f9c79dd55d0b687594d56a9 | |
parent | bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548) (diff) | |
download | cpython-6bc89116cb121c176453b9745e3daa2cc5df43ab.tar.gz cpython-6bc89116cb121c176453b9745e3daa2cc5df43ab.tar.bz2 cpython-6bc89116cb121c176453b9745e3daa2cc5df43ab.zip |
bpo-41299: Mark private thread_nt.h functions as static (GH-28553)
Mark the following thread_nt.h functions as static:
* AllocNonRecursiveMutex()
* FreeNonRecursiveMutex()
* EnterNonRecursiveMutex()
* LeaveNonRecursiveMutex()
-rw-r--r-- | Python/thread_nt.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h index e9dc880115f..f8c098ca523 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -32,8 +32,8 @@ typedef struct _NRMUTEX } NRMUTEX; typedef NRMUTEX *PNRMUTEX; -PNRMUTEX -AllocNonRecursiveMutex() +static PNRMUTEX +AllocNonRecursiveMutex(void) { PNRMUTEX m = (PNRMUTEX)PyMem_RawMalloc(sizeof(NRMUTEX)); if (!m) @@ -51,7 +51,7 @@ fail: return NULL; } -VOID +static VOID FreeNonRecursiveMutex(PNRMUTEX mutex) { if (mutex) { @@ -61,7 +61,7 @@ FreeNonRecursiveMutex(PNRMUTEX mutex) } } -DWORD +static DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds) { DWORD result = WAIT_OBJECT_0; @@ -101,7 +101,7 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds) return result; } -BOOL +static BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex) { BOOL result; @@ -119,26 +119,26 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex) /* NR-locks based on a kernel mutex */ #define PNRMUTEX HANDLE -PNRMUTEX -AllocNonRecursiveMutex() +static PNRMUTEX +AllocNonRecursiveMutex(void) { return CreateSemaphore(NULL, 1, 1, NULL); } -VOID +static VOID FreeNonRecursiveMutex(PNRMUTEX mutex) { /* No in-use check */ CloseHandle(mutex); } -DWORD +static DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds) { return WaitForSingleObjectEx(mutex, milliseconds, FALSE); } -BOOL +static BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex) { return ReleaseSemaphore(mutex, 1, NULL); |