globus_common 18.14
Loading...
Searching...
No Matches
globus_thread_rw_mutex.h
1/*
2 * Copyright 1999-2006 University of Chicago
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18#ifndef GLOBUS_THREAD_RW_MUTEX_H
19#define GLOBUS_THREAD_RW_MUTEX_H 1
20
22#include "globus_thread.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28typedef struct
29{
30 globus_mutex_t mutex;
31 struct globus_i_rw_mutex_waiter_s * waiters;
32 struct globus_i_rw_mutex_waiter_s ** tail;
33 struct globus_i_rw_mutex_waiter_s * idle;
34 globus_bool_t writing;
35 int readers;
36} globus_rw_mutex_t;
37
38typedef int globus_rw_mutexattr_t;
39
40int
41globus_rw_mutex_init(
42 globus_rw_mutex_t * rw_lock,
43 globus_rw_mutexattr_t * attr);
44
45int
46globus_rw_mutex_readlock(
47 globus_rw_mutex_t * rw_lock);
48
49int
50globus_rw_mutex_writelock(
51 globus_rw_mutex_t * rw_lock);
52
53int
54globus_rw_mutex_readunlock(
55 globus_rw_mutex_t * rw_lock);
56
57int
58globus_rw_mutex_writeunlock(
59 globus_rw_mutex_t * rw_lock);
60
61int
62globus_rw_mutex_destroy(
63 globus_rw_mutex_t * rw_lock);
64
75int
76globus_rw_cond_wait(
77 globus_cond_t * cond,
78 globus_rw_mutex_t * rw_lock);
79
80int
81globus_rw_cond_timedwait(
82 globus_cond_t * cond,
83 globus_rw_mutex_t * rw_lock,
84 globus_abstime_t * abstime);
85
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* GLOBUS_THREAD_RW_MUTEX_H */
Include System Headers.
Globus Threading Abstraction.
int globus_bool_t
Boolean type.
Definition globus_types.h:93
Condition variable.
Definition globus_thread.h:125
Mutex.
Definition globus_thread.h:108