X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5768b9f954f944e0c8c31a85a284b7e72a7ce3ee..131c883489555ae200d5d3c02b7448731949c352:/src/xbt/xbt_thread_context.c diff --git a/src/xbt/xbt_thread_context.c b/src/xbt/xbt_thread_context.c index 891a6dd887..60e6b26021 100644 --- a/src/xbt/xbt_thread_context.c +++ b/src/xbt/xbt_thread_context.c @@ -1,7 +1,18 @@ #include "xbt/function_types.h" #include "xbt/xbt_context_factory.h" -#include "xbt/xbt_thread_context.h" + +#include "portable.h" /* loads context system definitions */ +#include "xbt/swag.h" +#include "xbt/xbt_os_thread.h" + + +typedef struct s_xbt_thread_context { + XBT_CTX_BASE_T; + xbt_os_thread_t thread; /* a plain dumb thread (portable to posix or windows) */ + xbt_os_sem_t begin; /* this semaphore is used to schedule/yield the process */ + xbt_os_sem_t end; /* this semaphore is used to schedule/unschedule the process */ +} s_xbt_thread_context_t,* xbt_thread_context_t; static xbt_context_t xbt_thread_context_factory_create_context(const char* name, xbt_main_func_t code, void_f_pvoid_t startup_func, void* startup_arg, void_f_pvoid_t cleanup_func, void* cleanup_arg, int argc, char** argv); @@ -252,7 +263,7 @@ xbt_thread_context_wrapper(void* param) { xbt_thread_context_t context = (xbt_thread_context_t)param; - /* signal its starting to the maestro and wait to start its job*/ + /* Tell the maestro we are starting, and wait for its green light */ xbt_os_sem_release(context->end); xbt_os_sem_acquire(context->begin);