~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/thr_alarm.c

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#define ETIME ETIMEDOUT
33
33
#endif
34
34
 
35
 
uint thr_client_alarm;
 
35
uint32_t thr_client_alarm;
36
36
static int alarm_aborted=1;                     /* No alarm thread */
37
37
bool thr_alarm_inited= 0;
38
38
volatile bool alarm_thread_running= 0;
43
43
static pthread_cond_t COND_alarm;
44
44
static sigset_t full_signal_set;
45
45
static QUEUE alarm_queue;
46
 
static uint max_used_alarms=0;
 
46
static uint32_t max_used_alarms=0;
47
47
pthread_t alarm_thread;
48
48
 
49
49
#ifdef USE_ALARM_THREAD
62
62
  return (a < b) ? -1  : (a == b) ? 0 : 1;
63
63
}
64
64
 
65
 
void init_thr_alarm(uint max_alarms)
 
65
void init_thr_alarm(uint32_t max_alarms)
66
66
{
67
67
  sigset_t s;
68
68
  alarm_aborted=0;
112
112
}
113
113
 
114
114
 
115
 
void resize_thr_alarm(uint max_alarms)
 
115
void resize_thr_alarm(uint32_t max_alarms)
116
116
{
117
117
  pthread_mutex_lock(&LOCK_alarm);
118
118
  /*
144
144
    when the alarm has been given
145
145
*/
146
146
 
147
 
bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
 
147
bool thr_alarm(thr_alarm_t *alrm, uint32_t sec, ALARM *alarm_data)
148
148
{
149
149
  time_t now;
150
150
#ifndef USE_ONE_SIGNAL_HAND
236
236
#ifndef USE_ONE_SIGNAL_HAND
237
237
  sigset_t old_mask;
238
238
#endif
239
 
  uint i, found=0;
 
239
  uint32_t i, found=0;
240
240
 
241
241
#ifndef USE_ONE_SIGNAL_HAND
242
242
  pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
320
320
  {
321
321
    if (alarm_aborted)
322
322
    {
323
 
      uint i;
 
323
      uint32_t i;
324
324
      for (i=0 ; i < alarm_queue.elements ;)
325
325
      {
326
326
        alarm_data=(ALARM*) queue_element(&alarm_queue,i);
448
448
 
449
449
void thr_alarm_kill(my_thread_id thread_id)
450
450
{
451
 
  uint i;
 
451
  uint32_t i;
452
452
  if (alarm_aborted)
453
453
    return;
454
454
  pthread_mutex_lock(&LOCK_alarm);
578
578
 
579
579
static pthread_cond_t COND_thread_count;
580
580
static pthread_mutex_t LOCK_thread_count;
581
 
static uint thread_count;
 
581
static uint32_t thread_count;
582
582
 
583
583
#ifdef HPUX10
584
584
typedef int * fd_set_ptr;
625
625
      if (wait_time == 7)
626
626
      {                                         /* Simulate alarm-miss */
627
627
        fd_set readFDs;
628
 
        uint max_connection=fileno(stdin);
 
628
        uint32_t max_connection=fileno(stdin);
629
629
        FD_ZERO(&readFDs);
630
630
        FD_SET(max_connection,&readFDs);
631
631
        retry=0;