#include "xbt/log.h"
#include "xbt/swag.h"
#include "private.h"
+#include "simix/context.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix,
"Context switching mecanism");
-const char *xbt_ctx_factory_to_use = NULL;
-typedef void (*SIMIX_ctx_factory_initializer_t)(smx_context_factory_t *);
SIMIX_ctx_factory_initializer_t factory_initializer_to_use = NULL;
/**
/* select context factory to use to create the context(depends of the macro definitions) */
if (factory_initializer_to_use) {
(*factory_initializer_to_use)(&(simix_global->context_factory));
- } else {
-#ifdef CONTEXT_THREADS /* Use os threads (either pthreads or windows ones) */
- SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
-#elif defined(CONTEXT_UCONTEXT) /* use ucontext */
+ }
+ else {
+#ifdef CONTEXT_UCONTEXT /* use ucontext */
SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
+#elif defined(CONTEXT_THREADS) /* Use os threads (either pthreads or windows ones) */
+ SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
#else
#error ERROR [__FILE__, line __LINE__]: no context implementation specified.
#endif