GCS  0.2.3
gu_to.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Codership Oy <info@codership.com>
3  *
4  * $Id: gu_to.h 3515 2014-03-26 16:10:56Z yan $
5  */
6 
11 #ifndef _gu_to_h_
12 #define _gu_to_h_
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <stdint.h>
19 #include <stdbool.h>
20 #include <stdio.h>
21 
23 typedef int64_t gu_seqno_t;
24 
26 typedef struct gu_to gu_to_t;
27 
40 extern gu_to_t* gu_to_create (int len, gu_seqno_t seqno);
41 
48 extern long gu_to_destroy (gu_to_t** to);
49 
64 extern long gu_to_grab (gu_to_t* to, gu_seqno_t seqno);
65 
76 extern long gu_to_release (gu_to_t* to, gu_seqno_t seqno);
77 
86 extern gu_seqno_t gu_to_seqno (gu_to_t* to);
87 
99 extern long gu_to_cancel (gu_to_t *to, gu_seqno_t seqno);
100 
101 
105 extern long gu_to_self_cancel(gu_to_t *to, gu_seqno_t seqno);
106 
119 extern long gu_to_interrupt (gu_to_t *to, gu_seqno_t seqno);
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif // _gu_to_h_
long gu_to_cancel(gu_to_t *to, gu_seqno_t seqno)
cancels a TO monitor waiter making it return immediately It is assumed that the caller is currenly ho...
Definition: gu_to.c:316
long gu_to_self_cancel(gu_to_t *to, gu_seqno_t seqno)
Definition: gu_to.c:353
gu_seqno_t gu_to_seqno(gu_to_t *to)
The last sequence number that had been used to access TO object. Note that since no locks are held...
Definition: gu_to.c:311
Definition: gu_to.c:47
gu_to_t * gu_to_create(int len, gu_seqno_t seqno)
Creates TO object. TO object can be used to serialize access to application critical section using se...
Definition: gu_to.c:69
long gu_to_release(gu_to_t *to, gu_seqno_t seqno)
Releases TO specified resource. On succesful return unlocks the mutex associated with TO...
Definition: gu_to.c:272
long gu_to_interrupt(gu_to_t *to, gu_seqno_t seqno)
interrupts from TO monitor waiting state. Seqno remains valid in the queue and later seqnos still nee...
Definition: gu_to.c:388
long gu_to_destroy(gu_to_t **to)
Destroys TO object.
Definition: gu_to.c:116
long gu_to_grab(gu_to_t *to, gu_seqno_t seqno)
Grabs TO resource in the specified order. On successful return the mutex associated with specified TO...
Definition: gu_to.c:155