[Python-checkins] r46641 - python/trunk/Python/thread.c python/trunk/Python/thread_nt.h python/trunk/Python/thread_os2.h
andrew.macintyre
python-checkins at python.org
Sun Jun 4 15:00:00 CEST 2006
Author: andrew.macintyre
Date: Sun Jun 4 14:59:59 2006
New Revision: 46641
Modified:
python/trunk/Python/thread.c
python/trunk/Python/thread_nt.h
python/trunk/Python/thread_os2.h
Log:
clean up function declarations to conform to PEP-8 style.
Modified: python/trunk/Python/thread.c
==============================================================================
--- python/trunk/Python/thread.c (original)
+++ python/trunk/Python/thread.c Sun Jun 4 14:59:59 2006
@@ -75,7 +75,8 @@
static void PyThread__init_thread(void); /* Forward */
-void PyThread_init_thread(void)
+void
+PyThread_init_thread(void)
{
#ifdef Py_DEBUG
char *p = getenv("THREADDEBUG");
Modified: python/trunk/Python/thread_nt.h
==============================================================================
--- python/trunk/Python/thread_nt.h (original)
+++ python/trunk/Python/thread_nt.h Sun Jun 4 14:59:59 2006
@@ -16,7 +16,8 @@
typedef PVOID WINAPI interlocked_cmp_xchg_t(PVOID *dest, PVOID exc, PVOID comperand) ;
/* Sorry mate, but we haven't got InterlockedCompareExchange in Win95! */
-static PVOID WINAPI interlocked_cmp_xchg(PVOID *dest, PVOID exc, PVOID comperand)
+static PVOID WINAPI
+interlocked_cmp_xchg(PVOID *dest, PVOID exc, PVOID comperand)
{
static LONG spinlock = 0 ;
PVOID result ;
@@ -54,8 +55,10 @@
return result ;
} ;
-static interlocked_cmp_xchg_t *ixchg ;
-BOOL InitializeNonRecursiveMutex(PNRMUTEX mutex)
+static interlocked_cmp_xchg_t *ixchg;
+
+BOOL
+InitializeNonRecursiveMutex(PNRMUTEX mutex)
{
if (!ixchg)
{
@@ -76,14 +79,16 @@
#endif
#define InterlockedCompareExchange(dest,exchange,comperand) (ixchg((dest), (exchange), (comperand)))
-VOID DeleteNonRecursiveMutex(PNRMUTEX mutex)
+VOID
+DeleteNonRecursiveMutex(PNRMUTEX mutex)
{
/* No in-use check */
CloseHandle(mutex->hevent) ;
mutex->hevent = NULL ; /* Just in case */
}
-DWORD EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
+DWORD
+EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
{
/* Assume that the thread waits successfully */
DWORD ret ;
@@ -104,7 +109,8 @@
return ret ;
}
-BOOL LeaveNonRecursiveMutex(PNRMUTEX mutex)
+BOOL
+LeaveNonRecursiveMutex(PNRMUTEX mutex)
{
/* We don't own the mutex */
mutex->thread_id = 0 ;
@@ -113,7 +119,8 @@
SetEvent(mutex->hevent) ; /* Other threads are waiting, wake one on them up */
}
-PNRMUTEX AllocNonRecursiveMutex(void)
+PNRMUTEX
+AllocNonRecursiveMutex(void)
{
PNRMUTEX mutex = (PNRMUTEX)malloc(sizeof(NRMUTEX)) ;
if (mutex && !InitializeNonRecursiveMutex(mutex))
@@ -124,7 +131,8 @@
return mutex ;
}
-void FreeNonRecursiveMutex(PNRMUTEX mutex)
+void
+FreeNonRecursiveMutex(PNRMUTEX mutex)
{
if (mutex)
{
@@ -138,7 +146,8 @@
/*
* Initialization of the C package, should not be needed.
*/
-static void PyThread__init_thread(void)
+static void
+PyThread__init_thread(void)
{
}
@@ -209,7 +218,8 @@
* Return the thread Id instead of an handle. The Id is said to uniquely identify the
* thread in the system
*/
-long PyThread_get_thread_ident(void)
+long
+PyThread_get_thread_ident(void)
{
if (!initialized)
PyThread_init_thread();
@@ -217,7 +227,8 @@
return GetCurrentThreadId();
}
-static void do_PyThread_exit_thread(int no_cleanup)
+static void
+do_PyThread_exit_thread(int no_cleanup)
{
dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
if (!initialized)
@@ -228,18 +239,21 @@
_endthread();
}
-void PyThread_exit_thread(void)
+void
+PyThread_exit_thread(void)
{
do_PyThread_exit_thread(0);
}
-void PyThread__exit_thread(void)
+void
+PyThread__exit_thread(void)
{
do_PyThread_exit_thread(1);
}
#ifndef NO_EXIT_PROG
-static void do_PyThread_exit_prog(int status, int no_cleanup)
+static void
+do_PyThread_exit_prog(int status, int no_cleanup)
{
dprintf(("PyThread_exit_prog(%d) called\n", status));
if (!initialized)
@@ -249,12 +263,14 @@
exit(status);
}
-void PyThread_exit_prog(int status)
+void
+PyThread_exit_prog(int status)
{
do_PyThread_exit_prog(status, 0);
}
-void PyThread__exit_prog(int status)
+void
+PyThread__exit_prog(int status)
{
do_PyThread_exit_prog(status, 1);
}
@@ -265,7 +281,8 @@
* I [Dag] tried to implement it with mutex but I could find a way to
* tell whether a thread already own the lock or not.
*/
-PyThread_type_lock PyThread_allocate_lock(void)
+PyThread_type_lock
+PyThread_allocate_lock(void)
{
PNRMUTEX aLock;
@@ -280,7 +297,8 @@
return (PyThread_type_lock) aLock;
}
-void PyThread_free_lock(PyThread_type_lock aLock)
+void
+PyThread_free_lock(PyThread_type_lock aLock)
{
dprintf(("%ld: PyThread_free_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
@@ -293,7 +311,8 @@
* and 0 if the lock was not acquired. This means a 0 is returned
* if the lock has already been acquired by this thread!
*/
-int PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
+int
+PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
{
int success ;
@@ -306,7 +325,8 @@
return success;
}
-void PyThread_release_lock(PyThread_type_lock aLock)
+void
+PyThread_release_lock(PyThread_type_lock aLock)
{
dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
Modified: python/trunk/Python/thread_os2.h
==============================================================================
--- python/trunk/Python/thread_os2.h (original)
+++ python/trunk/Python/thread_os2.h Sun Jun 4 14:59:59 2006
@@ -244,7 +244,8 @@
return 1;
}
-void PyThread_release_lock(PyThread_type_lock aLock)
+void
+PyThread_release_lock(PyThread_type_lock aLock)
{
#if !defined(PYCC_GCC)
type_os2_lock lock = (type_os2_lock)aLock;
More information about the Python-checkins
mailing list