|
|
1.1 ! root 1: /* ! 2: ** Lockdriver moved to user process 7/19/82 ! 3: ** ! 4: ** @(#)ildr.h 8.1 12/31/84 ! 5: */ ! 6: ! 7: /* Only the parameters NLOCKS, PLOCKS, RLOCKS and DLOCKS ! 8: * may be changed by an INGRES installation. See ! 9: * 'HOW TO INSTALL CONCURRENCY DEVICE' for details. ! 10: * The file can be printed by "nroff .../doc/other/lockdev.nr" ! 11: */ ! 12: ! 13: # define DLOCKS 10 /* max number of data base locks (limits # of ingreses */ ! 14: # define RLOCKS (2*DLOCKS + 6) ! 15: # define PLOCKS (RLOCKS + 3) ! 16: # define NLOCKS (PLOCKS + 1) ! 17: # define KEYSIZE 12 ! 18: ! 19: # define M_EMTY 0 ! 20: # define M_SHARE 2 ! 21: # define M_EXCL 1 ! 22: ! 23: # define T_CS 0 ! 24: # define T_PAGE 1 ! 25: # define T_REL 2 ! 26: # define T_DB 3 ! 27: ! 28: # define A_RTN 1 ! 29: # define A_SLP 2 ! 30: # define A_RLS1 3 ! 31: # define A_RLSA 4 ! 32: # define A_ABT 5 ! 33: ! 34: # define W_ON 1 ! 35: # define W_OFF 0 ! 36: ! 37: struct Lockreq ! 38: /* Lock Request */ ! 39: { ! 40: char lr_act; /* requested action: ! 41: * =1 request lock, err return ! 42: * =2 request lock, sleep ! 43: * =3 release lock ! 44: * =4 release all locks for pid ! 45: */ ! 46: char lr_type; /* same as Locktab l_type */ ! 47: char lr_mod; /* same as Locktab l_mod */ ! 48: char lr_key[KEYSIZE];/* requested key */ ! 49: }; ! 50: ! 51: ! 52: # define LOCKPRI (PZERO+1) /* sleep priority */ ! 53: ! 54: /* ! 55: * data structure for Lock table ! 56: */ ! 57: struct Lockform ! 58: { ! 59: int l_pid; ! 60: char l_wflag; /* wait flag: = 1 a process is waiting*/ ! 61: char l_type; /* type of lock: ! 62: = 0 for critical section ! 63: = 1 for page ! 64: = 2 for logical ! 65: = 3 for data base ! 66: */ ! 67: char l_mod; /* mod of Lock or lock action requested ! 68: * = 0 slot empty ! 69: * = 1 exclusive lock ! 70: * = 2 shared lock ! 71: */ ! 72: char l_key[KEYSIZE]; ! 73: } Locktab[NLOCKS]; ! 74: ! 75: int Lockset[] = ! 76: /* array of number of locks which can be ! 77: * set for each lock. ! 78: */ ! 79: { ! 80: NLOCKS, ! 81: PLOCKS, ! 82: RLOCKS, ! 83: DLOCKS ! 84: }; ! 85:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.