Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jens Gustedt
P99 - macros and functions for C99
Commits
75047aa8
Commit
75047aa8
authored
Sep 16, 2013
by
Jens Gustedt
Browse files
don't allow foreign threads to finish silently
parent
46424373
Changes
1
Hide whitespace changes
Inline
Side-by-side
p99/p99_threads.h
View file @
75047aa8
...
...
@@ -875,11 +875,10 @@ void thrd_exit(int p00_res) {
}
/* should only be reached by threads that where created directly
with pthreads, e.g main */
if
(
p00_res
)
fprintf
(
stderr
,
"P99: We are exiting a foreign thread (main?) with non zero error code %d
\n
"
"P99: There is no consistent way we can transmit that error code to the environment
\n
"
,
p00_res
);
fprintf
(
stderr
,
"P99: We are exiting a foreign thread (main?) with error code %d
\n
"
"P99: There is no consistent way we can transmit that code to the environment
\n
"
,
p00_res
);
pthread_exit
(
0
);
}
#endif
...
...
@@ -921,6 +920,8 @@ int p00_threads_main(void* p00_arg) {
return statement is permitted. But the compiler should warn the
user about that. */
int
p00_ret
=
p99_threads_main
(
p00_argc
,
p00_argv
);
fprintf
(
stderr
,
"exiting main thread with code %d"
,
p00_ret
);
fflush
(
0
);
exit
(
p00_ret
);
}
...
...
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