~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/thr_lock.c

  • Committer: Monty Taylor
  • Date: 2008-09-23 14:19:48 UTC
  • mto: This revision was merged to the branch mainline in revision 419.
  • Revision ID: monty@inaugust.com-20080923141948-ktph2kg13addaxq1
Actually removed VOID() this time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
void thr_lock_init(THR_LOCK *lock)
301
301
{
302
302
  memset(lock, 0, sizeof(*lock));
303
 
  VOID(pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST));
 
303
  pthread_mutex_init(&lock->mutex,MY_MUTEX_INIT_FAST);
304
304
  lock->read.last= &lock->read.data;
305
305
  lock->read_wait.last= &lock->read_wait.data;
306
306
  lock->write_wait.last= &lock->write_wait.data;
316
316
 
317
317
void thr_lock_delete(THR_LOCK *lock)
318
318
{
319
 
  VOID(pthread_mutex_destroy(&lock->mutex));
 
319
  pthread_mutex_destroy(&lock->mutex);
320
320
  pthread_mutex_lock(&THR_LOCK_lock);
321
321
  thr_lock_thread_list=list_delete(thr_lock_thread_list,&lock->list);
322
322
  pthread_mutex_unlock(&THR_LOCK_lock);
475
475
  data->cond=0;                                 /* safety */
476
476
  data->type=lock_type;
477
477
  data->owner= owner;                           /* Must be reset ! */
478
 
  VOID(pthread_mutex_lock(&lock->mutex));
 
478
  pthread_mutex_lock(&lock->mutex);
479
479
  check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ?
480
480
              "enter read_lock" : "enter write_lock",0);
481
481
  if ((int) lock_type <= (int) TL_READ_NO_INSERT)
706
706
      lock->read_no_write_count++;
707
707
    }      
708
708
    data->cond=0;                               /* Mark thread free */
709
 
    VOID(pthread_cond_signal(cond));
 
709
    pthread_cond_signal(cond);
710
710
  } while ((data=data->next));
711
711
  *lock->read_wait.last=0;
712
712
  if (!lock->read_wait.data)
806
806
          {
807
807
            pthread_cond_t *cond=data->cond;
808
808
            data->cond=0;                               /* Mark thread free */
809
 
            VOID(pthread_cond_signal(cond));    /* Start waiting thread */
 
809
            pthread_cond_signal(cond);  /* Start waiting thread */
810
810
          }
811
811
          if (data->type != TL_WRITE_ALLOW_WRITE ||
812
812
              !lock->write_wait.data ||
853
853
        lock->write.last= &data->next;
854
854
        data->next=0;                           /* Only one write lock */
855
855
        data->cond=0;                           /* Mark thread free */
856
 
        VOID(pthread_cond_signal(cond));        /* Start waiting thread */
 
856
        pthread_cond_signal(cond);      /* Start waiting thread */
857
857
      } while (lock_type == TL_WRITE_ALLOW_WRITE &&
858
858
               (data=lock->write_wait.data) &&
859
859
               data->type == TL_WRITE_ALLOW_WRITE);
1329
1329
  thr_print_locks();
1330
1330
  pthread_mutex_lock(&LOCK_thread_count);
1331
1331
  thread_count--;
1332
 
  VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
 
1332
  pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
1333
1333
  pthread_mutex_unlock(&LOCK_thread_count);
1334
1334
  free((uchar*) arg);
1335
1335
  return 0;
1388
1388
  }
1389
1389
#endif
1390
1390
#ifdef HAVE_THR_SETCONCURRENCY
1391
 
  VOID(thr_setconcurrency(2));
 
1391
  thr_setconcurrency(2);
1392
1392
#endif
1393
1393
  for (i=0 ; i < (int) array_elements(lock_counts) ; i++)
1394
1394
  {