24 #ifndef USE_ALARM_THREAD
25 #define USE_ONE_SIGNAL_HAND
27 #ifdef HAVE_rts_threads
28 #undef USE_ONE_SIGNAL_HAND
29 #define USE_ALARM_THREAD
30 #define THR_SERVER_ALARM SIGUSR1
32 #define THR_SERVER_ALARM SIGALRM
37 ulong next_alarm_time;
44 #if defined(DONT_USE_THR_ALARM)
46 #define USE_ALARM_THREAD
47 #undef USE_ONE_SIGNAL_HAND
49 typedef my_bool thr_alarm_t;
50 typedef my_bool
ALARM;
52 #define thr_alarm_init(A) (*(A))=0
53 #define thr_alarm_in_use(A) (*(A) != 0)
54 #define thr_end_alarm(A)
55 #define thr_alarm(A,B,C) ((*(A)=1)-1)
57 #define thr_got_alarm(A) 0
58 #define init_thr_alarm(A)
59 #define thr_alarm_kill(A)
60 #define resize_thr_alarm(N)
61 #define end_thr_alarm(A)
65 typedef struct st_thr_alarm_entry
72 typedef int thr_alarm_entry;
74 #define thr_got_alarm(thr_alarm) (**(thr_alarm))
78 typedef thr_alarm_entry* thr_alarm_t;
82 thr_alarm_entry alarmed;
84 my_thread_id thread_id;
88 extern uint thr_client_alarm;
89 extern pthread_t alarm_thread;
91 #define thr_alarm_init(A) (*(A))=0
92 #define thr_alarm_in_use(A) (*(A)!= 0)
93 void init_thr_alarm(uint max_alarm);
94 void resize_thr_alarm(uint max_alarms);
95 my_bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff);
96 void thr_alarm_kill(my_thread_id thread_id);
97 void thr_end_alarm(thr_alarm_t *alarmed);
98 void end_thr_alarm(my_bool free_structures);
99 sig_handler process_alarm(
int);
100 #ifndef thr_got_alarm
101 my_bool thr_got_alarm(thr_alarm_t *alrm);