40
40
in the signaled state, i.e., a thread
41
41
does not stop if it tries to wait for
43
ib_int64_t signal_count; /* this is incremented each time
43
ib_longlong signal_count; /* this is incremented each time
44
44
the event becomes signaled */
45
45
pthread_cond_t cond_var; /* condition variable is used in
46
46
waiting for the event */
105
105
/**************************************************************
106
106
Sets an event semaphore to the signaled state: lets waiting threads
112
112
os_event_t event); /* in: event to set */
113
113
/**************************************************************
114
114
Resets an event semaphore to the nonsignaled state. Waiting threads will
115
stop to wait for the event.
116
The return value should be passed to os_even_wait_low() if it is desired
117
that this thread should not wait in case of an intervening call to
118
os_event_set() between this os_event_reset() and the
119
os_event_wait_low() call. See comments for os_event_wait_low(). */
115
stop to wait for the event. */
124
120
os_event_t event); /* in: event to reset */
125
121
/**************************************************************
126
122
Frees an event object. */
131
127
os_event_t event); /* in: event to free */
133
128
/**************************************************************
134
129
Waits for an event object until it is in the signaled state. If
135
130
srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
136
131
waiting thread when the event becomes signaled (or immediately if the
137
event is already in the signaled state).
139
Typically, if the event has been signalled after the os_event_reset()
140
we'll return immediately because event->is_set == TRUE.
141
There are, however, situations (e.g.: sync_array code) where we may
142
lose this information. For example:
144
thread A calls os_event_reset()
145
thread B calls os_event_set() [event->is_set == TRUE]
146
thread C calls os_event_reset() [event->is_set == FALSE]
147
thread A calls os_event_wait() [infinite wait!]
148
thread C calls os_event_wait() [infinite wait!]
150
Where such a scenario is possible, to avoid infinite wait, the
151
value returned by os_event_reset() should be passed in as
132
event is already in the signaled state). */
157
os_event_t event, /* in: event to wait */
158
ib_int64_t reset_sig_count);/* in: zero or the value
159
returned by previous call of
162
#define os_event_wait(event) os_event_wait_low(event, 0)
137
os_event_t event); /* in: event to wait */
164
138
/**************************************************************
165
139
Waits for an event object until it is in the signaled state or
166
140
a timeout is exceeded. In Unix the timeout is always infinite. */
169
143
os_event_wait_time(
170
144
/*===============*/
202
176
the mutex is created without a name */
203
177
/**************************************************************
204
178
Acquires ownership of a mutex semaphore. */
209
183
os_mutex_t mutex); /* in: mutex to acquire */
210
184
/**************************************************************
211
185
Releases ownership of a mutex. */
216
190
os_mutex_t mutex); /* in: mutex to release */
217
191
/**************************************************************
218
192
Frees an mutex object. */
234
208
os_fast_mutex_t* fast_mutex); /* in: mutex to acquire */
235
209
/**************************************************************
236
210
Releases ownership of a fast mutex. */
239
213
os_fast_mutex_unlock(
240
214
/*=================*/
241
215
os_fast_mutex_t* fast_mutex); /* in: mutex to release */
242
216
/*************************************************************
243
217
Initializes an operating system fast mutex semaphore. */
246
220
os_fast_mutex_init(
247
221
/*===============*/
248
222
os_fast_mutex_t* fast_mutex); /* in: fast mutex */
249
223
/**************************************************************
250
224
Acquires ownership of a fast mutex. */
253
227
os_fast_mutex_lock(
254
228
/*===============*/
255
229
os_fast_mutex_t* fast_mutex); /* in: mutex to acquire */
256
230
/**************************************************************
257
231
Frees an mutex object. */
260
234
os_fast_mutex_free(
261
235
/*===============*/