Back to index

glibc  2.9
Functions
queue.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void enqueue (pthread_descr *q, pthread_descr th)
static pthread_descr dequeue (pthread_descr *q)
static int remove_from_queue (pthread_descr *q, pthread_descr th)
static int queue_is_empty (pthread_descr *q)

Function Documentation

static pthread_descr dequeue ( pthread_descr q) [inline, static]

Definition at line 35 of file queue.h.

{
  pthread_descr th;
  th = *q;
  if (th != NULL) {
    *q = th->p_nextwaiting;
    th->p_nextwaiting = NULL;
  }
  return th;
}

Here is the caller graph for this function:

static void enqueue ( pthread_descr q,
pthread_descr  th 
) [inline, static]

Definition at line 21 of file queue.h.

{
  int prio = th->p_priority;
  ASSERT(th->p_nextwaiting == NULL);
  for (; *q != NULL; q = &((*q)->p_nextwaiting)) {
    if (prio > (*q)->p_priority) {
      th->p_nextwaiting = *q;
      *q = th;
      return;
    }
  }
  *q = th;
}

Here is the caller graph for this function:

static int queue_is_empty ( pthread_descr q) [inline, static]

Definition at line 58 of file queue.h.

{
    return *q == NULL;
}

Here is the caller graph for this function:

static int remove_from_queue ( pthread_descr q,
pthread_descr  th 
) [inline, static]

Definition at line 46 of file queue.h.

{
  for (; *q != NULL; q = &((*q)->p_nextwaiting)) {
    if (*q == th) {
      *q = th->p_nextwaiting;
      th->p_nextwaiting = NULL;
      return 1;
    }
  }
  return 0;
}

Here is the caller graph for this function: