thread.h 395 Bytes
Newer Older
Bob Halley's avatar
add  
Bob Halley committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

#ifndef THREAD_H
#define THREAD_H 1

#ifdef MULTITHREADED

#include <pthread.h>

#include <isc/assertions.h>

typedef pthread_t			os_thread_t;

#define os_thread_create(s, a, tp)	(pthread_create((tp), NULL, (s), (a)) \
					 == 0)
#define os_thread_detach(t)		INSIST(pthread_detach((t)) == 0)

Bob Halley's avatar
update  
Bob Halley committed
17 18 19 20
#else

#error Threads are not meaningful for a non-threaded program.

Bob Halley's avatar
add  
Bob Halley committed
21 22 23
#endif

#endif /* THREAD_H */