Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c4c127b8
Commit
c4c127b8
authored
Dec 04, 2002
by
Andrew MacIntyre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reformat for PEP-7 style conformance
parent
69049599
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
121 deletions
+132
-121
Python/thread_os2.h
Python/thread_os2.h
+132
-121
No files found.
Python/thread_os2.h
View file @
c4c127b8
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment