Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rewrite a comment
[simgrid.git] / src / xbt / xbt_thread_context.c
index 891a6dd..60e6b26 100644 (file)
@@ -1,7 +1,18 @@
 \r
 #include "xbt/function_types.h"\r
 #include "xbt/xbt_context_factory.h"\r
-#include "xbt/xbt_thread_context.h"\r
+\r
+#include "portable.h"                  /* loads context system definitions */\r
+#include "xbt/swag.h"\r
+#include "xbt/xbt_os_thread.h"\r
+\r
+\r
+typedef struct s_xbt_thread_context {\r
+       XBT_CTX_BASE_T;\r
+       xbt_os_thread_t thread;                 /* a plain dumb thread (portable to posix or windows) */\r
+       xbt_os_sem_t begin;                             /* this semaphore is used to schedule/yield the process  */\r
+       xbt_os_sem_t end;                               /* this semaphore is used to schedule/unschedule the process   */\r
+} s_xbt_thread_context_t,* xbt_thread_context_t;\r
 \r
 static xbt_context_t \r
 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);\r
@@ -252,7 +263,7 @@ xbt_thread_context_wrapper(void* param)
 {\r
        xbt_thread_context_t context = (xbt_thread_context_t)param;\r
        \r
-       /* signal its starting to the maestro and wait to start its job*/\r
+       /* Tell the maestro we are starting, and wait for its green light */\r
        xbt_os_sem_release(context->end);               \r
        xbt_os_sem_acquire(context->begin);\r
        \r