ObjFW  Check-in [a1c5b19c7c]

Overview
Comment:Inline of_condition_* on Win32 as well to prevent warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a1c5b19c7c059bf7cbac6fdab6ae6b787a1d5160b8987fd740d53dffbe9b18f1
User & Date: js on 2011-05-29 21:47:45
Other Links: manifest | tags
Context
2011-06-03
15:14
Add deserialization. check-in: dca3061dfc user: js tags: trunk
2011-05-29
21:47
Inline of_condition_* on Win32 as well to prevent warnings. check-in: a1c5b19c7c user: js tags: trunk
21:46
Fix 3 typos introduced by style changes. check-in: 4090b00720 user: js tags: trunk
Changes

Modified src/threading.h from [ffa37b7f10] to [e3a63de0b8].

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
	if ((condition->event = CreateEvent(NULL, FALSE, 0, NULL)) == NULL)
		return NO;

	return YES;
#endif
}

#if defined(OF_HAVE_PTHREADS)
static OF_INLINE BOOL
#elif defined(_WIN32)
static BOOL
#endif
of_condition_wait(of_condition_t *condition, of_mutex_t *mutex)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_wait(condition, mutex);
#elif defined(_WIN32)
	if (!of_mutex_unlock(mutex))
		return NO;







<

<
<
<







177
178
179
180
181
182
183

184



185
186
187
188
189
190
191
	if ((condition->event = CreateEvent(NULL, FALSE, 0, NULL)) == NULL)
		return NO;

	return YES;
#endif
}


static OF_INLINE BOOL



of_condition_wait(of_condition_t *condition, of_mutex_t *mutex)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_wait(condition, mutex);
#elif defined(_WIN32)
	if (!of_mutex_unlock(mutex))
		return NO;
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_signal(condition);
#elif defined(_WIN32)
	return SetEvent(condition->event);
#endif
}

#if defined(OF_HAVE_PTHREADS)
static OF_INLINE BOOL
#elif defined(_WIN32)
static BOOL
#endif
of_condition_broadcast(of_condition_t *condition)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_broadcast(condition);
#elif defined(_WIN32)
	size_t i;

	for (i = 0; i < condition->count; i++)
		if (!SetEvent(condition->event))
			return NO;

	return YES;
#endif
}

#if defined(OF_HAVE_PTHREADS)
static OF_INLINE BOOL
#elif defined(_WIN32)
static BOOL
#endif
of_condition_free(of_condition_t *condition)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_destroy(condition);
#elif defined(_WIN32)
	if (condition->count)
		return NO;







<

<
<
<















<

<
<
<







212
213
214
215
216
217
218

219



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

235



236
237
238
239
240
241
242
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_signal(condition);
#elif defined(_WIN32)
	return SetEvent(condition->event);
#endif
}


static OF_INLINE BOOL



of_condition_broadcast(of_condition_t *condition)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_broadcast(condition);
#elif defined(_WIN32)
	size_t i;

	for (i = 0; i < condition->count; i++)
		if (!SetEvent(condition->event))
			return NO;

	return YES;
#endif
}


static OF_INLINE BOOL



of_condition_free(of_condition_t *condition)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_cond_destroy(condition);
#elif defined(_WIN32)
	if (condition->count)
		return NO;