plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

queue.h (299B)


      1 enum
      2 {
      3 	MAXQ = 256
      4 };
      5 
      6 typedef struct Queue Queue;
      7 struct Queue
      8 {
      9 	struct {
     10 		Block *db;
     11 		u32int bno;
     12 	} el[MAXQ];
     13 	int ri, wi, nel, closed;
     14 
     15 	QLock lk;
     16 	Rendez r;
     17 };
     18 
     19 Queue	*qalloc(void);
     20 void	qclose(Queue*);
     21 Block	*qread(Queue*, u32int*);
     22 void	qwrite(Queue*, Block*, u32int);
     23 void	qfree(Queue*);