1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
/**************************************************************
*
* Creation Date: <1999-02-01 05:41:03 samuel>
* Time-stamp: <2000/10/29 17:32:39 samuel>
*
* <thread.h>
*
* Thread manager
*
* Copyright (C) 1999, 2000 Samuel Rydh (samuel@ibrium.se)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation
*
**************************************************************/
#ifndef _H_THREAD
#define _H_THREAD
#if 1
/* Not defined in <ptherad.h> any more? */
extern int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
#endif
extern void threadpool_init( void );
extern void threadpool_cleanup( void );
extern pthread_t create_thread( void (*entry)(void*), void *data, const char *thread_name );
extern const char *get_thread_name( void );
extern int is_main_thread( void );
extern void set_thread_sigmask( void );
extern int kill_thread( pthread_t th );
extern pthread_t __main_th;
static inline pthread_t get_main_th( void ) {
return __main_th;
}
#endif /* _H_THREAD */
|