Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Usefull function to "kill" a context before the function it was executing has terminated.
[simgrid.git] / include / xbt / context.h
index 044325e..ea8a6f5 100644 (file)
@@ -8,14 +8,21 @@
 #ifndef _XBT_CONTEXT_H
 #define _XBT_CONTEXT_H
 
-typedef struct s_context *context_t;
-typedef int(*context_function_t)(int argc, char *argv[]);
+#include "xbt/misc.h"
 
-void context_init(void);
-void context_empty_trash(void);
-context_t context_create(context_function_t code, int argc, char *argv[]);
-void context_start(context_t context);
-void context_yield(context_t context);
-int context_get_id(context_t context);
+typedef struct s_xbt_context *xbt_context_t;
+typedef int(*xbt_context_function_t)(int argc, char *argv[]);
+
+void xbt_context_init(void);
+void xbt_context_exit(void);
+void xbt_context_empty_trash(void);
+xbt_context_t xbt_context_new(xbt_context_function_t code, 
+                             void_f_pvoid_t startup_func, void *startup_arg,
+                             void_f_pvoid_t cleanup_func, void *cleanup_arg,
+                             int argc, char *argv[]);
+void xbt_context_free(xbt_context_t context);
+void xbt_context_start(xbt_context_t context);
+void xbt_context_yield(void);
+void xbt_context_schedule(xbt_context_t context);
 
 #endif                         /* _XBT_CONTEXT_H */