|
|
1.1 ! root 1: /* q.h - firstid, firstkey, isempty, lastkey, nonempty */ ! 2: ! 3: /* q structure declarations, constants, and inline procedures */ ! 4: ! 5: #ifndef NQENT ! 6: #define NQENT NPROC + NSEM + NSEM + 4 /* for ready & sleep */ ! 7: /* & preemption */ ! 8: #endif ! 9: ! 10: struct qent { /* one for each process plus two for */ ! 11: /* each list */ ! 12: short qkey; /* key on which the queue is ordered */ ! 13: short qnext; /* pointer to next process or tail */ ! 14: short qprev; /* pointer to previous process or head */ ! 15: }; ! 16: ! 17: extern struct qent q[]; ! 18: extern int nextqueue; ! 19: ! 20: /* inline list manipulation procedures */ ! 21: ! 22: #define isempty(list) (q[(list)].qnext >= NPROC) ! 23: #define nonempty(list) (q[(list)].qnext < NPROC) ! 24: #define firstkey(list) (q[q[(list)].qnext].qkey) ! 25: #define lastkey(tail) (q[q[(tail)].qprev].qkey) ! 26: #define firstid(list) (q[(list)].qnext) ! 27: ! 28: #define EMPTY -1 /* equivalent of null pointer */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.