A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix sem_init testing.
[simgrid.git]
/
src
/
xbt
/
xbt_os_thread.c
diff --git
a/src/xbt/xbt_os_thread.c
b/src/xbt/xbt_os_thread.c
index
2b8326e
..
10f8266
100644
(file)
--- a/
src/xbt/xbt_os_thread.c
+++ b/
src/xbt/xbt_os_thread.c
@@
-95,7
+95,7
@@
void xbt_os_thread_mod_preinit(void)
thread_mod_inited = 1;
thread_mod_inited = 1;
-#ifndef HAVE_SEM_
WA
IT
+#ifndef HAVE_SEM_
IN
IT
next_sem_ID_lock = xbt_os_mutex_init();
#endif
next_sem_ID_lock = xbt_os_mutex_init();
#endif
@@
-113,7
+113,7
@@
void xbt_os_thread_mod_postexit(void)
free(main_thread);
main_thread = NULL;
thread_mod_inited = 0;
free(main_thread);
main_thread = NULL;
thread_mod_inited = 0;
-#ifndef HAVE_SEM_
WA
IT
+#ifndef HAVE_SEM_
IN
IT
xbt_os_mutex_destroy(next_sem_ID_lock);
#endif
xbt_os_mutex_destroy(next_sem_ID_lock);
#endif
@@
-122,6
+122,12
@@
void xbt_os_thread_mod_postexit(void)
__xbt_ex_terminate = &__xbt_ex_terminate_default;
}
__xbt_ex_terminate = &__xbt_ex_terminate_default;
}
+int xbt_os_thread_atfork(void (*prepare)(void),
+ void (*parent)(void), void (*child)(void))
+{
+ return pthread_atfork(prepare, parent, child);
+}
+
static void *wrapper_start_routine(void *s)
{
xbt_os_thread_t t = s;
static void *wrapper_start_routine(void *s)
{
xbt_os_thread_t t = s;
@@
-162,8
+168,8
@@
const char *xbt_os_thread_name(xbt_os_thread_t t)
const char *xbt_os_thread_self_name(void)
{
const char *xbt_os_thread_self_name(void)
{
- xbt_os_thread_t
self
= xbt_os_thread_self();
- return
self ? self
->name : "main";
+ xbt_os_thread_t
me
= xbt_os_thread_self();
+ return
me ? me
->name : "main";
}
void xbt_os_thread_join(xbt_os_thread_t thread, void **thread_return)
}
void xbt_os_thread_join(xbt_os_thread_t thread, void **thread_return)
@@
-618,6
+624,12
@@
void xbt_os_thread_mod_postexit(void)
"TlsFree() failed to cleanup the thread submodule");
}
"TlsFree() failed to cleanup the thread submodule");
}
+int xbt_os_thread_atfork(void (*prepare)(void),
+ void (*parent)(void), void (*child)(void))
+{
+ return 0;
+}
+
static DWORD WINAPI wrapper_start_routine(void *s)
{
xbt_os_thread_t t = (xbt_os_thread_t) s;
static DWORD WINAPI wrapper_start_routine(void *s)
{
xbt_os_thread_t t = (xbt_os_thread_t) s;