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(...)
28 typedef struct mcs_mutex_s * MCS_Mutex;
30 #define MCS_MTX_ELEM_DISP 0
31 #define MCS_MTX_TAIL_DISP 1
33 int MCS_Mutex_create(int tail_rank, MPI_Comm comm, MCS_Mutex * hdl_out);
34 int MCS_Mutex_free(MCS_Mutex * hdl_ptr);
35 int MCS_Mutex_lock(MCS_Mutex hdl);
36 int MCS_Mutex_trylock(MCS_Mutex hdl, int *success);
37 int MCS_Mutex_unlock(MCS_Mutex hdl);
39 #endif /* MCSMUTEX_H_INCLUDED */