mirror of https://github.com/python/cpython.git
reformat for PEP-7 style conformance
This commit is contained in:
parent
6904959921
commit
c4c127b850
|
@ -33,9 +33,9 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
|
|||
|
||||
aThread = _beginthread(func,NULL,65536,arg);
|
||||
|
||||
if( aThread == -1 ) {
|
||||
if (aThread == -1) {
|
||||
success = -1;
|
||||
fprintf(stderr,"aThread failed == %d",aThread);
|
||||
fprintf(stderr, "aThread failed == %d", aThread);
|
||||
dprintf(("_beginthread failed. return %ld\n", errno));
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ PyThread_get_thread_ident(void)
|
|||
#if defined(PYCC_GCC)
|
||||
return _gettid();
|
||||
#else
|
||||
DosGetInfoBlocks(&tib,&pib);
|
||||
DosGetInfoBlocks(&tib, &pib);
|
||||
return tib->tib_ptib2->tib2_ultid;
|
||||
#endif
|
||||
}
|
||||
|
@ -64,7 +64,8 @@ PyThread_get_thread_ident(void)
|
|||
static void
|
||||
do_PyThread_exit_thread(int no_cleanup)
|
||||
{
|
||||
dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
|
||||
dprintf(("%ld: PyThread_exit_thread called\n",
|
||||
PyThread_get_thread_ident()));
|
||||
if (!initialized)
|
||||
if (no_cleanup)
|
||||
_exit(0);
|
||||
|
@ -135,7 +136,7 @@ PyThread_allocate_lock(void)
|
|||
free(sem);
|
||||
sem = NULL;
|
||||
}
|
||||
return (PyThread_type_lock) sem;
|
||||
return (PyThread_type_lock)sem;
|
||||
#else
|
||||
APIRET rc;
|
||||
type_os2_lock lock = (type_os2_lock)malloc(sizeof(struct os2_lock_t));
|
||||
|
@ -152,7 +153,7 @@ PyThread_allocate_lock(void)
|
|||
PyThread_get_thread_ident(),
|
||||
lock->changed));
|
||||
|
||||
return (PyThread_type_lock) lock;
|
||||
return (PyThread_type_lock)lock;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -163,7 +164,8 @@ PyThread_free_lock(PyThread_type_lock aLock)
|
|||
type_os2_lock lock = (type_os2_lock)aLock;
|
||||
#endif
|
||||
|
||||
dprintf(("%ld: PyThread_free_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
|
||||
dprintf(("%ld: PyThread_free_lock(%p) called\n",
|
||||
PyThread_get_thread_ident(),aLock));
|
||||
|
||||
#if defined(PYCC_GCC)
|
||||
if (aLock) {
|
||||
|
@ -192,24 +194,28 @@ PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
|
|||
type_os2_lock lock = (type_os2_lock)aLock;
|
||||
#endif
|
||||
|
||||
dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),
|
||||
aLock, waitflag));
|
||||
dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n",
|
||||
PyThread_get_thread_ident(),
|
||||
aLock,
|
||||
waitflag));
|
||||
|
||||
#if defined(PYCC_GCC)
|
||||
/* always successful if the lock doesn't exist */
|
||||
if (aLock && _fmutex_request((_fmutex *)aLock, waitflag ? 0 : _FMR_NOWAIT))
|
||||
if (aLock &&
|
||||
_fmutex_request((_fmutex *)aLock, waitflag ? 0 : _FMR_NOWAIT))
|
||||
return 0;
|
||||
#else
|
||||
while (!done) {
|
||||
/* if the lock is currently set, we have to wait for the state to change */
|
||||
/* if the lock is currently set, we have to wait for
|
||||
* the state to change
|
||||
*/
|
||||
if (lock->is_set) {
|
||||
if (!waitflag)
|
||||
return 0;
|
||||
DosWaitEventSem(lock->changed, SEM_INDEFINITE_WAIT);
|
||||
}
|
||||
|
||||
/*
|
||||
* enter a critical section and try to get the semaphore. If
|
||||
/* enter a critical section and try to get the semaphore. If
|
||||
* it is still locked, we will try again.
|
||||
*/
|
||||
if (DosEnterCritSec())
|
||||
|
@ -234,7 +240,9 @@ void PyThread_release_lock(PyThread_type_lock aLock)
|
|||
type_os2_lock lock = (type_os2_lock)aLock;
|
||||
#endif
|
||||
|
||||
dprintf(("%ld: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
|
||||
dprintf(("%ld: PyThread_release_lock(%p) called\n",
|
||||
PyThread_get_thread_ident(),
|
||||
aLock));
|
||||
|
||||
#if defined(PYCC_GCC)
|
||||
if (aLock)
|
||||
|
@ -242,14 +250,17 @@ void PyThread_release_lock(PyThread_type_lock aLock)
|
|||
#else
|
||||
if (!lock->is_set) {
|
||||
dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
|
||||
PyThread_get_thread_ident(), aLock, GetLastError()));
|
||||
PyThread_get_thread_ident(),
|
||||
aLock,
|
||||
GetLastError()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (DosEnterCritSec()) {
|
||||
dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
|
||||
PyThread_get_thread_ident(), aLock, GetLastError()));
|
||||
PyThread_get_thread_ident(),
|
||||
aLock,
|
||||
GetLastError()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue