/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
   This file is public domain and comes with NO WARRANTY of any kind */

/* Prototypes when using thr_alarm library functions */

#ifndef _thr_alarm_h
#define _thr_alarm_h
#ifdef	__cplusplus
extern "C" {
#endif

#define USE_ONE_SIGNAL_HAND		/* One must call process_alarm */
#ifdef HAVE_LINUXTHREADS
#define THR_CLIENT_ALARM SIGALRM
#else
#define THR_CLIENT_ALARM SIGUSR1
#endif
#ifdef HAVE_rts_threads
#undef USE_ONE_SIGNAL_HAND
#define USE_ALARM_THREAD
#define THR_SERVER_ALARM SIGUSR1
#else
#define THR_SERVER_ALARM SIGALRM
#endif

void init_thr_alarm(uint max_alarm);
int *thr_alarm(uint sec);
void thr_end_alarm(int *alarmed);
void thr_alarm_kill(pthread_t thread_id);
void end_thr_alarm(void);
sig_handler process_alarm(int);

#ifdef	__cplusplus
}
#endif
#endif
