A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hello xbt/synchro module (synchronization working both in simulation and real life...
[simgrid.git]
/
src
/
xbt
/
xbt_os_thread.c
diff --git
a/src/xbt/xbt_os_thread.c
b/src/xbt/xbt_os_thread.c
index
91b38fe
..
a4b7fa8
100644
(file)
--- a/
src/xbt/xbt_os_thread.c
+++ b/
src/xbt/xbt_os_thread.c
@@
-23,6
+23,7
@@
#include <pthread.h>
typedef struct xbt_os_thread_ {
#include <pthread.h>
typedef struct xbt_os_thread_ {
+ /* KEEP IT IN SYNC WITH xbt_thread.c */
pthread_t t;
void *param;
pvoid_f_pvoid_t *start_routine;
pthread_t t;
void *param;
pvoid_f_pvoid_t *start_routine;
@@
-99,6
+100,7
@@
void xbt_os_thread_yield(void) {
}
/****** mutex related functions ******/
typedef struct xbt_os_mutex_ {
}
/****** mutex related functions ******/
typedef struct xbt_os_mutex_ {
+ /* KEEP IT IN SYNC WITH xbt_thread.c */
pthread_mutex_t m;
} s_xbt_os_mutex_t;
pthread_mutex_t m;
} s_xbt_os_mutex_t;
@@
-142,6
+144,7
@@
void xbt_os_mutex_destroy(xbt_os_mutex_t mutex) {
/***** condition related functions *****/
typedef struct xbt_os_cond_ {
/***** condition related functions *****/
typedef struct xbt_os_cond_ {
+ /* KEEP IT IN SYNC WITH xbt_thread.c */
pthread_cond_t c;
} s_xbt_os_cond_t;
pthread_cond_t c;
} s_xbt_os_cond_t;
@@
-191,6
+194,7
@@
void xbt_os_cond_destroy(xbt_os_cond_t cond){
#elif defined(WIN32)
typedef struct xbt_os_thread_ {
#elif defined(WIN32)
typedef struct xbt_os_thread_ {
+ /* KEEP IT IN SYNC WITH xbt_thread */
HANDLE handle; /* the win thread handle */
unsigned long id; /* the win thread id */
pvoid_f_pvoid_t *start_routine;
HANDLE handle; /* the win thread handle */
unsigned long id; /* the win thread id */
pvoid_f_pvoid_t *start_routine;
@@
-272,6
+276,7
@@
void xbt_os_thread_yield(void) {
/****** mutex related functions ******/
typedef struct xbt_os_mutex_ {
/****** mutex related functions ******/
typedef struct xbt_os_mutex_ {
+ /* KEEP IT IN SYNC WITH xbt_thread.c */
CRITICAL_SECTION lock;
} s_xbt_os_mutex_t;
CRITICAL_SECTION lock;
} s_xbt_os_mutex_t;
@@
-311,6
+316,7
@@
void xbt_os_mutex_destroy(xbt_os_mutex_t mutex) {
};
typedef struct xbt_os_cond_ {
};
typedef struct xbt_os_cond_ {
+ /* KEEP IT IN SYNC WITH xbt_thread.c */
HANDLE events[MAX_EVENTS];
unsigned int waiters_count; /* the number of waiters */
HANDLE events[MAX_EVENTS];
unsigned int waiters_count; /* the number of waiters */