1 /***************************************/
2 /* thread global variable declarations */
3 /***************************************/
4 
5 /* $Id: thr_bufs2.h 625 2011-03-23 17:21:38Z wrp $ */
6 
7 #ifndef MAX_WORKERS
8 #define MAX_WORKERS 2
9 #endif
10 
11 #ifndef XTERNAL
12 struct buf_head **worker_buf;  /* pointers to full buffers */
13 struct buf_head **reader_buf;  /* pointers to empty buffers */
14 
15 /* protected by worker_mutex/worker_cond_var */
16  /* indices into full-buffers ptrs */
17 int worker_buf_workp;	/* modified by get_wbuf() */
18 int worker_buf_readp;	/* modified by put_rbuf() */
19 int num_worker_bufs;
20 int reader_done;
21 
22 /* protected by reader_mutex/reader_cond var */
23  /* indices into empty-buffers ptrs */
24 int reader_buf_workp;	/* modified by put_wbuf() */
25 int reader_buf_readp;	/* modified by get_rbuf(), main()-- after rbuf_wait */
26 int num_reader_bufs;
27 int reader_wait;
28 
29 /* protected by start_mutex/start_cont_var */
30 int start_thread=1;        /* start-up predicate, 0 starts */
31 #else
32 extern struct buf_head **worker_buf;
33 extern struct buf_head **reader_buf;
34 extern int num_worker_bufs, reader_done;
35 extern int num_reader_bufs, reader_wait;
36 extern int worker_buf_workp, worker_buf_readp;
37 extern int reader_buf_workp, reader_buf_readp;
38 
39 extern int start_thread;
40 #endif
41 
42