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
f070cfd2
Commit
f070cfd2
authored
Apr 19, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #716969: Detect thread creation failure. Will backport to 2.2.
parent
2c46a572
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
Python/thread_pthread.h
Python/thread_pthread.h
+8
-6
Python/thread_solaris.h
Python/thread_solaris.h
+1
-3
No files found.
Python/thread_pthread.h
View file @
f070cfd2
...
...
@@ -188,7 +188,7 @@ long
PyThread_start_new_thread
(
void
(
*
func
)(
void
*
),
void
*
arg
)
{
pthread_t
th
;
int
s
ucces
s
;
int
s
tatu
s
;
sigset_t
oldmask
,
newmask
;
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_t
attrs
;
...
...
@@ -214,7 +214,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
sigfillset
(
&
newmask
);
SET_THREAD_SIGMASK
(
SIG_BLOCK
,
&
newmask
,
&
oldmask
);
s
ucces
s
=
pthread_create
(
&
th
,
s
tatu
s
=
pthread_create
(
&
th
,
#if defined(PY_PTHREAD_D4)
pthread_attr_default
,
(
pthread_startroutine_t
)
func
,
...
...
@@ -244,13 +244,15 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_destroy
(
&
attrs
);
#endif
if
(
success
==
0
)
{
if
(
status
!=
0
)
return
-
1
;
#if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7)
pthread_detach
(
&
th
);
#elif defined(PY_PTHREAD_STD)
pthread_detach
(
th
);
#endif
}
#if SIZEOF_PTHREAD_T <= SIZEOF_LONG
return
(
long
)
th
;
#else
...
...
Python/thread_solaris.h
View file @
f070cfd2
...
...
@@ -40,8 +40,6 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
{
thread_t
tid
;
struct
func_arg
*
funcarg
;
int
success
=
0
;
/* init not needed when SOLARIS_THREADS and */
/* C_THREADS implemented properly */
dprintf
((
"PyThread_start_new_thread called
\n
"
));
if
(
!
initialized
)
...
...
@@ -53,7 +51,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
THR_DETACHED
|
THR_NEW_LWP
,
&
tid
))
{
perror
(
"thr_create"
);
free
((
void
*
)
funcarg
);
success
=
-
1
;
return
-
1
;
}
return
tid
;
}
...
...
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