1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2013 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
7 #if !defined MCSMUTEX_H_INCLUDED
8 #define MCSMUTEX_H_INCLUDED
12 #define MCS_MUTEX_TAG 100
15 #define debug_print(...) do { printf(__VA_ARGS__); } while (0)
17 #define debug_print(...)
27 typedef struct mcs_mutex_s * MCS_Mutex;
29 #define MCS_MTX_ELEM_DISP 0
30 #define MCS_MTX_TAIL_DISP 1
32 int MCS_Mutex_create(int tail_rank, MPI_Comm comm, MCS_Mutex * hdl_out);
33 int MCS_Mutex_free(MCS_Mutex * hdl_ptr);
34 int MCS_Mutex_lock(MCS_Mutex hdl);
35 int MCS_Mutex_trylock(MCS_Mutex hdl, int *success);
36 int MCS_Mutex_unlock(MCS_Mutex hdl);
38 #endif /* MCSMUTEX_H_INCLUDED */