Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
For win64 it is cast unsigned long long.
[simgrid.git] / src / xbt / parmap_private.h
1 /* Copyright (c) 2004, 2005, 2007, 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_THREADPOOL_PRIVATE_H
8 #define _XBT_THREADPOOL_PRIVATE_H
9
10 #include "xbt/parmap.h"
11 #include "xbt/xbt_os_thread.h"
12 #include "xbt/sysdep.h"
13 #include "xbt/dynar.h"
14 #include "xbt/log.h"
15 #include "xbt/xbt_os_time.h"
16
17 typedef enum{
18   PARMAP_WORK = 0,
19   PARMAP_DESTROY
20 } e_xbt_parmap_flag_t;
21
22 #ifdef HAVE_FUTEX_H
23 typedef struct s_xbt_event{
24   int work;
25   int done;
26   unsigned int thread_counter;
27   unsigned int threads_to_wait;
28 }s_xbt_event_t, *xbt_event_t;
29
30 void xbt_event_init(xbt_event_t event);
31 void xbt_event_signal(xbt_event_t event);
32 void xbt_event_wait(xbt_event_t event);
33 void xbt_event_end(xbt_event_t event);
34 #endif
35
36 typedef struct s_xbt_parmap {
37   e_xbt_parmap_flag_t status;
38 #ifdef HAVE_FUTEX_H
39   xbt_event_t sync_event;
40 #endif
41   unsigned int num_workers;
42   unsigned int workers_max_id;
43   void_f_pvoid_t fun;
44   xbt_dynar_t data;
45   unsigned int index;
46 } s_xbt_parmap_t;
47
48 #endif