mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
reformat for PEP-7 style conformance
This commit is contained in:
parent
6904959921
commit
c4c127b850
1 changed files with 128 additions and 117 deletions
|
@ -64,7 +64,8 @@ PyThread_get_thread_ident(void)
|
||||||
static void
|
static void
|
||||||
do_PyThread_exit_thread(int no_cleanup)
|
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 (!initialized)
|
||||||
if (no_cleanup)
|
if (no_cleanup)
|
||||||
_exit(0);
|
_exit(0);
|
||||||
|
@ -163,7 +164,8 @@ PyThread_free_lock(PyThread_type_lock aLock)
|
||||||
type_os2_lock lock = (type_os2_lock)aLock;
|
type_os2_lock lock = (type_os2_lock)aLock;
|
||||||
#endif
|
#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 defined(PYCC_GCC)
|
||||||
if (aLock) {
|
if (aLock) {
|
||||||
|
@ -192,24 +194,28 @@ PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
|
||||||
type_os2_lock lock = (type_os2_lock)aLock;
|
type_os2_lock lock = (type_os2_lock)aLock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),
|
dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n",
|
||||||
aLock, waitflag));
|
PyThread_get_thread_ident(),
|
||||||
|
aLock,
|
||||||
|
waitflag));
|
||||||
|
|
||||||
#if defined(PYCC_GCC)
|
#if defined(PYCC_GCC)
|
||||||
/* always successful if the lock doesn't exist */
|
/* 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;
|
return 0;
|
||||||
#else
|
#else
|
||||||
while (!done) {
|
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 (lock->is_set) {
|
||||||
if (!waitflag)
|
if (!waitflag)
|
||||||
return 0;
|
return 0;
|
||||||
DosWaitEventSem(lock->changed, SEM_INDEFINITE_WAIT);
|
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.
|
* it is still locked, we will try again.
|
||||||
*/
|
*/
|
||||||
if (DosEnterCritSec())
|
if (DosEnterCritSec())
|
||||||
|
@ -234,7 +240,9 @@ void PyThread_release_lock(PyThread_type_lock aLock)
|
||||||
type_os2_lock lock = (type_os2_lock)aLock;
|
type_os2_lock lock = (type_os2_lock)aLock;
|
||||||
#endif
|
#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 defined(PYCC_GCC)
|
||||||
if (aLock)
|
if (aLock)
|
||||||
|
@ -242,14 +250,17 @@ void PyThread_release_lock(PyThread_type_lock aLock)
|
||||||
#else
|
#else
|
||||||
if (!lock->is_set) {
|
if (!lock->is_set) {
|
||||||
dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
|
dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
|
||||||
PyThread_get_thread_ident(), aLock, GetLastError()));
|
PyThread_get_thread_ident(),
|
||||||
|
aLock,
|
||||||
|
GetLastError()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (DosEnterCritSec()) {
|
if (DosEnterCritSec()) {
|
||||||
dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
|
dprintf(("%ld: Could not PyThread_release_lock(%p) error: %l\n",
|
||||||
PyThread_get_thread_ident(), aLock, GetLastError()));
|
PyThread_get_thread_ident(),
|
||||||
|
aLock,
|
||||||
|
GetLastError()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue