Skip to content

Commit 6bc8911

Browse files
authored
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()
1 parent d639e31 commit 6bc8911

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Python/thread_nt.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ typedef struct _NRMUTEX
3232
} NRMUTEX;
3333
typedef NRMUTEX *PNRMUTEX;
3434

35-
PNRMUTEX
36-
AllocNonRecursiveMutex()
35+
static PNRMUTEX
36+
AllocNonRecursiveMutex(void)
3737
{
3838
PNRMUTEX m = (PNRMUTEX)PyMem_RawMalloc(sizeof(NRMUTEX));
3939
if (!m)
@@ -51,7 +51,7 @@ AllocNonRecursiveMutex()
5151
return NULL;
5252
}
5353

54-
VOID
54+
static VOID
5555
FreeNonRecursiveMutex(PNRMUTEX mutex)
5656
{
5757
if (mutex) {
@@ -61,7 +61,7 @@ FreeNonRecursiveMutex(PNRMUTEX mutex)
6161
}
6262
}
6363

64-
DWORD
64+
static DWORD
6565
EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
6666
{
6767
DWORD result = WAIT_OBJECT_0;
@@ -101,7 +101,7 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
101101
return result;
102102
}
103103

104-
BOOL
104+
static BOOL
105105
LeaveNonRecursiveMutex(PNRMUTEX mutex)
106106
{
107107
BOOL result;
@@ -119,26 +119,26 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex)
119119
/* NR-locks based on a kernel mutex */
120120
#define PNRMUTEX HANDLE
121121

122-
PNRMUTEX
123-
AllocNonRecursiveMutex()
122+
static PNRMUTEX
123+
AllocNonRecursiveMutex(void)
124124
{
125125
return CreateSemaphore(NULL, 1, 1, NULL);
126126
}
127127

128-
VOID
128+
static VOID
129129
FreeNonRecursiveMutex(PNRMUTEX mutex)
130130
{
131131
/* No in-use check */
132132
CloseHandle(mutex);
133133
}
134134

135-
DWORD
135+
static DWORD
136136
EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
137137
{
138138
return WaitForSingleObjectEx(mutex, milliseconds, FALSE);
139139
}
140140

141-
BOOL
141+
static BOOL
142142
LeaveNonRecursiveMutex(PNRMUTEX mutex)
143143
{
144144
return ReleaseSemaphore(mutex, 1, NULL);

0 commit comments

Comments
 (0)