Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a fifo instead of a swag of sleeping processes on a semaphore (so that waitany...
[simgrid.git] / src / include / simix / context.h
1 /* Copyright (c) 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5   * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef XBT_CONTEXT_H
8 #define XBT_CONTEXT_H
9
10 #include "xbt/misc.h"                           /* XBT_PUBLIC(), SG_BEGIN_DECL() and SG_END_DECL() definitions  */
11 #include "xbt/function_types.h"         /* function pointer types declarations                                                  */      
12 #include "xbt_modinter.h"                       /* xbt_context_init() and xbt_context_exit() declarations               */
13      
14 SG_BEGIN_DECL() 
15  
16 typedef struct s_xbt_context *xbt_context_t;
17
18 XBT_PUBLIC(xbt_context_t) xbt_context_new(const char *name, xbt_main_func_t code,
19                 void_f_pvoid_t startup_func, void *startup_arg,
20                 void_f_pvoid_t cleanup_func, void *cleanup_arg, int argc, char *argv[]);
21
22 XBT_PUBLIC(void) xbt_context_kill(xbt_context_t context);
23
24 XBT_PUBLIC(void) xbt_context_start(xbt_context_t context);
25
26 XBT_PUBLIC(void) xbt_context_yield(void);
27
28 XBT_PUBLIC(void) xbt_context_schedule(xbt_context_t context);
29      
30 void xbt_context_empty_trash(void);
31
32 void xbt_context_stop(int exit_code);
33      
34 void xbt_context_free(xbt_context_t context);
35
36 SG_END_DECL() 
37  
38 #endif  /* !XBT_CONTEXT_H */