1
/***********************************************************************
2
* Code listing from "Advanced Linux Programming," by CodeSourcery LLC *
3
* Copyright (C) 2001 by New Riders Publishing *
4
* See COPYRIGHT for license information. *
5
***********************************************************************/
10
/* Link field for linked list. */
13
/* Other fields describing work to be done... */
16
/* A linked list of pending jobs. */
17
struct job* job_queue;
19
extern void process_job (struct job*);
21
/* Process queued jobs until the queue is empty. */
23
void* thread_function (void* arg)
25
while (job_queue != NULL) {
26
/* Get the next available job. */
27
struct job* next_job = job_queue;
28
/* Remove this job from the list. */
29
job_queue = job_queue->next;
30
/* Carry out the work. */
31
process_job (next_job);