diff options
author | Victor Stinner <vstinner@python.org> | 2021-09-24 23:14:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 23:14:09 (GMT) |
commit | 6bc89116cb121c176453b9745e3daa2cc5df43ab (patch) | |
tree | 2cc90cc3afaf2ad40f9c79dd55d0b687594d56a9 /Python/thread_nt.h | |
parent | d639e3170506a1a80c4b2f1b3a6250bb95ff190a (diff) | |
download | cpython-6bc89116cb121c176453b9745e3daa2cc5df43ab.zip cpython-6bc89116cb121c176453b9745e3daa2cc5df43ab.tar.gz cpython-6bc89116cb121c176453b9745e3daa2cc5df43ab.tar.bz2 |
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()
Diffstat (limited to 'Python/thread_nt.h')
-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 e9dc880..f8c098c 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); |