Mercury
mercury_thread_mutex.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Argonne National Laboratory, Department of Energy,
3  *                    UChicago Argonne, LLC and The HDF Group.
4  * All rights reserved.
5  *
6  * The full copyright notice, including terms governing use, modification,
7  * and redistribution, is contained in the COPYING file that can be
8  * found at the root of the source code distribution tree.
9  */
10 
11 #ifndef MERCURY_THREAD_MUTEX_H
12 #define MERCURY_THREAD_MUTEX_H
13 
14 #include "mercury_util_config.h"
15 #ifdef _WIN32
16  #include <windows.h>
17  typedef CRITICAL_SECTION hg_thread_mutex_t;
18 #else
19  #include <pthread.h>
20  #include <errno.h>
21  typedef pthread_mutex_t hg_thread_mutex_t;
22 #endif
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
35 HG_UTIL_EXPORT int
37 
45 HG_UTIL_EXPORT int
47 
55 HG_UTIL_EXPORT int
57 
65 HG_UTIL_EXPORT int
67 
75 HG_UTIL_EXPORT int
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* MERCURY_THREAD_MUTEX_H */
HG_UTIL_EXPORT int hg_thread_mutex_init(hg_thread_mutex_t *mutex)
Initialize the mutex.
HG_UTIL_EXPORT int hg_thread_mutex_destroy(hg_thread_mutex_t *mutex)
Destroy the mutex.
HG_UTIL_EXPORT int hg_thread_mutex_try_lock(hg_thread_mutex_t *mutex)
Try locking the mutex.
HG_UTIL_EXPORT int hg_thread_mutex_lock(hg_thread_mutex_t *mutex)
Lock the mutex.
pthread_mutex_t hg_thread_mutex_t
HG_UTIL_EXPORT int hg_thread_mutex_unlock(hg_thread_mutex_t *mutex)
Unlock the mutex.