Skip to content

Commit b4cfb4e

Browse files
author
andrew.macintyre
committed
clean up function declarations to conform to PEP-7 style.
git-svn-id: http://svn.python.org/projects/python/trunk@46641 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent a9e288a commit b4cfb4e

3 files changed

Lines changed: 44 additions & 22 deletions

File tree

Python/thread.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ static int initialized;
7575

7676
static void PyThread__init_thread(void); /* Forward */
7777

78-
void PyThread_init_thread(void)
78+
void
79+
PyThread_init_thread(void)
7980
{
8081
#ifdef Py_DEBUG
8182
char *p = getenv("THREADDEBUG");

Python/thread_nt.h

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ typedef struct NRMUTEX {
1616
typedef PVOID WINAPI interlocked_cmp_xchg_t(PVOID *dest, PVOID exc, PVOID comperand) ;
1717

1818
/* Sorry mate, but we haven't got InterlockedCompareExchange in Win95! */
19-
static PVOID WINAPI interlocked_cmp_xchg(PVOID *dest, PVOID exc, PVOID comperand)
19+
static PVOID WINAPI
20+
interlocked_cmp_xchg(PVOID *dest, PVOID exc, PVOID comperand)
2021
{
2122
static LONG spinlock = 0 ;
2223
PVOID result ;
@@ -54,8 +55,10 @@ static PVOID WINAPI interlocked_cmp_xchg(PVOID *dest, PVOID exc, PVOID comperand
5455
return result ;
5556
} ;
5657

57-
static interlocked_cmp_xchg_t *ixchg ;
58-
BOOL InitializeNonRecursiveMutex(PNRMUTEX mutex)
58+
static interlocked_cmp_xchg_t *ixchg;
59+
60+
BOOL
61+
InitializeNonRecursiveMutex(PNRMUTEX mutex)
5962
{
6063
if (!ixchg)
6164
{
@@ -76,14 +79,16 @@ BOOL InitializeNonRecursiveMutex(PNRMUTEX mutex)
7679
#endif
7780
#define InterlockedCompareExchange(dest,exchange,comperand) (ixchg((dest), (exchange), (comperand)))
7881

79-
VOID DeleteNonRecursiveMutex(PNRMUTEX mutex)
82+
VOID
83+
DeleteNonRecursiveMutex(PNRMUTEX mutex)
8084
{
8185
/* No in-use check */
8286
CloseHandle(mutex->hevent) ;
8387
mutex->hevent = NULL ; /* Just in case */
8488
}
8589

86-
DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
90+
DWORD
91+
EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
8792
{
8893
/* Assume that the thread waits successfully */
8994
DWORD ret ;
@@ -104,7 +109,8 @@ DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
104109
return ret ;
105110
}
106111

107-
BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex)
112+
BOOL
113+
LeaveNonRecursiveMutex(PNRMUTEX mutex)
108114
{
109115
/* We don't own the mutex */
110116
mutex->thread_id = 0 ;
@@ -113,7 +119,8 @@ BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex)
113119
SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */
114120
}
115121

116-
PNRMUTEX AllocNonRecursiveMutex(void)
122+
PNRMUTEX
123+
AllocNonRecursiveMutex(void)
117124
{
118125
PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ;
119126
if (mutex && !InitializeNonRecursiveMutex(mutex))
@@ -124,7 +131,8 @@ PNRMUTEX AllocNonRecursiveMutex(void)
124131
return mutex ;
125132
}
126133

127-
void FreeNonRecursiveMutex(PNRMUTEX mutex)
134+
void
135+
FreeNonRecursiveMutex(PNRMUTEX mutex)
128136
{
129137
if (mutex)
130138
{
@@ -138,7 +146,8 @@ long PyThread_get_thread_ident(void);
138146
/*
139147
* Initialization of the C package, should not be needed.
140148
*/
141-
static void PyThread__init_thread(void)
149+
static void
150+
PyThread__init_thread(void)
142151
{
143152
}
144153

@@ -209,15 +218,17 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
209218
* Return the thread Id instead of an handle. The Id is said to uniquely identify the
210219
* thread in the system
211220
*/
212-
long PyThread_get_thread_ident(void)
221+
long
222+
PyThread_get_thread_ident(void)
213223
{
214224
if (!initialized)
215225
PyThread_init_thread();
216226

217227
return GetCurrentThreadId();
218228
}
219229

220-
static void do_PyThread_exit_thread(int no_cleanup)
230+
static void
231+
do_PyThread_exit_thread(int no_cleanup)
221232
{
222233
dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
223234
if (!initialized)
@@ -228,18 +239,21 @@ static void do_PyThread_exit_thread(int no_cleanup)
228239
_endthread();
229240
}
230241

231-
void PyThread_exit_thread(void)
242+
void
243+
PyThread_exit_thread(void)
232244
{
233245
do_PyThread_exit_thread(0);
234246
}
235247

236-
void PyThread__exit_thread(void)
248+
void
249+
PyThread__exit_thread(void)
237250
{
238251
do_PyThread_exit_thread(1);
239252
}
240253

241254
#ifndef NO_EXIT_PROG
242-
static void do_PyThread_exit_prog(int status, int no_cleanup)
255+
static void
256+
do_PyThread_exit_prog(int status, int no_cleanup)
243257
{
244258
dprintf(("PyThread_exit_prog(%d) called\n", status));
245259
if (!initialized)
@@ -249,12 +263,14 @@ static void do_PyThread_exit_prog(int status, int no_cleanup)
249263
exit(status);
250264
}
251265

252-
void PyThread_exit_prog(int status)
266+
void
267+
PyThread_exit_prog(int status)
253268
{
254269
do_PyThread_exit_prog(status, 0);
255270
}
256271

257-
void PyThread__exit_prog(int status)
272+
void
273+
PyThread__exit_prog(int status)
258274
{
259275
do_PyThread_exit_prog(status, 1);
260276
}
@@ -265,7 +281,8 @@ void PyThread__exit_prog(int status)
265281
* I [Dag] tried to implement it with mutex but I could find a way to
266282
* tell whether a thread already own the lock or not.
267283
*/
268-
PyThread_type_lock PyThread_allocate_lock(void)
284+
PyThread_type_lock
285+
PyThread_allocate_lock(void)
269286
{
270287
PNRMUTEX aLock;
271288

@@ -280,7 +297,8 @@ PyThread_type_lock PyThread_allocate_lock(void)
280297
return (PyThread_type_lock) aLock;
281298
}
282299

283-
void PyThread_free_lock(PyThread_type_lock aLock)
300+
void
301+
PyThread_free_lock(PyThread_type_lock aLock)
284302
{
285303
dprintf(("%ld: PyThread_free_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
286304

@@ -293,7 +311,8 @@ void PyThread_free_lock(PyThread_type_lock aLock)
293311
* and 0 if the lock was not acquired. This means a 0 is returned
294312
* if the lock has already been acquired by this thread!
295313
*/
296-
int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
314+
int
315+
PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
297316
{
298317
int success ;
299318

@@ -306,7 +325,8 @@ int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
306325
return success;
307326
}
308327

309-
void PyThread_release_lock(PyThread_type_lock aLock)
328+
void
329+
PyThread_release_lock(PyThread_type_lock aLock)
310330
{
311331
dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
312332

Python/thread_os2.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
244244
return 1;
245245
}
246246

247-
void PyThread_release_lock(PyThread_type_lock aLock)
247+
void
248+
PyThread_release_lock(PyThread_type_lock aLock)
248249
{
249250
#if !defined(PYCC_GCC)
250251
type_os2_lock lock = (type_os2_lock)aLock;

0 commit comments

Comments
 (0)