Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
support for wine testsuite execution: do not run the helper scripts from within wine...
[simgrid.git] / src / xbt / context_private.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _XBT_CONTEXT_PRIVATE_H
9 #define _XBT_CONTEXT_PRIVATE_H
10
11 #define HAVE_CONTEXT 1
12
13 #include "xbt/sysdep.h"
14 #include "xbt/context.h"
15
16 #ifdef HAVE_LIBPTHREAD
17 #include <pthread.h>
18 typedef struct s_context {
19   pthread_cond_t cond;
20   pthread_mutex_t mutex;
21   pthread_t *thread;            /* the thread that execute the code   */
22   context_function_t code;                /* the scheduler fonction   */
23   int argc;
24   char *argv[];
25 } s_context_t;
26 #endif
27
28 #if HAVE_CONTEXT==1
29 #include <stdlib.h>
30 #include <ucontext.h>
31 #define STACK_SIZE 524288
32 typedef struct s_context {
33   ucontext_t uc;                /* the thread that execute the code   */
34   char stack[STACK_SIZE];
35   context_function_t code;        /* the scheduler fonction   */
36   int argc;
37   char **argv;
38   struct s_context *save;
39 } s_context_t;
40 #endif
41
42 #endif              /* _XBT_CONTEXT_PRIVATE_H */