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
move comments around so that they don't induce a syntax error in the generated config...
[simgrid.git]
/
src
/
xbt
/
context.c
diff --git
a/src/xbt/context.c
b/src/xbt/context.c
index
5ab348d
..
1ca6c8a
100644
(file)
--- a/
src/xbt/context.c
+++ b/
src/xbt/context.c
@@
-29,6
+29,7
@@
static xbt_swag_t context_living = NULL;
/* don't want to play with conditional compilation in automake tonight, sorry.
include directly the c file from here when needed. */
# include "context_win32.c"
/* don't want to play with conditional compilation in automake tonight, sorry.
include directly the c file from here when needed. */
# include "context_win32.c"
+# define USE_WIN_CONTEXT
# endif
#endif
# endif
#endif
@@
-221,7
+222,7
@@
xbt_context_t xbt_context_new(xbt_context_function_t code,
res->thread = xbt_new0(pthread_t,1);
xbt_assert0(!pthread_mutex_init(&(res->mutex), NULL), "Mutex initialization error");
xbt_assert0(!pthread_cond_init(&(res->cond), NULL), "Condition initialization error");
res->thread = xbt_new0(pthread_t,1);
xbt_assert0(!pthread_mutex_init(&(res->mutex), NULL), "Mutex initialization error");
xbt_assert0(!pthread_cond_init(&(res->cond), NULL), "Condition initialization error");
-#else
+#else
/* FIXME: strerror is not thread safe */
xbt_assert2(getcontext(&(res->uc))==0,"Error in context saving: %d (%s)", errno, strerror(errno));
res->uc.uc_link = NULL;
/* FIXME: strerror is not thread safe */
xbt_assert2(getcontext(&(res->uc))==0,"Error in context saving: %d (%s)", errno, strerror(errno));
res->uc.uc_link = NULL;
@@
-229,9
+230,11
@@
xbt_context_t xbt_context_new(xbt_context_function_t code,
/* WARNING : when this context is over, the current_context (i.e. the
father), is awaken... Theorically, the wrapper should prevent using
this feature. */
/* WARNING : when this context is over, the current_context (i.e. the
father), is awaken... Theorically, the wrapper should prevent using
this feature. */
- res->uc.uc_stack.ss_sp = res->stack;
- res->uc.uc_stack.ss_size = STACK_SIZE;
-#endif
+# ifndef USE_WIN_CONTEXT
+ res->uc.uc_stack.ss_sp = pth_skaddr_makecontext(res->stack,STACK_SIZE);
+ res->uc.uc_stack.ss_size = pth_sksize_makecontext(res->stack,STACK_SIZE);
+# endif /* USE_WIN_CONTEXT */
+#endif /* USE_PTHREADS or not */
res->argc = argc;
res->argv = argv;
res->startup_func = startup_func;
res->argc = argc;
res->argv = argv;
res->startup_func = startup_func;