# 2.11BSD#431 - /usr/ingres/source/iutil/rllocks.c

##### Functions

    setrll            X
    unlrl             X

##### Variables

    Lock              X

       1: # include   "../ingres.h"
       2: # include   "../lock.h"
       3: struct lockreq  Lock;
       4: /*
       5: /*
       6:  *	setrll- set a relation lock
       7:  */
       8: setrll(act, rtid, mod)
       9: char    act;
      10: long    rtid;
      11: char    mod;
      12: {
      13:     register char   *r;
      14:     register int    i;
      15:
      16: #	ifdef xATR1
      17:     if (tTf(98,  4))
      18:         printf(" setrll a=%d r=%s m=%o \n", act, locv(rtid),  mod);
      19: #	endif
      20:     if (Alockdes < 0)
      21:         return(1);
      22:     Lock.lract = act;   /* sleep (act = 2) or error return (act = 1)*/
      23:     Lock.lrtype = T_REL;    /* relation lock */
      24:     Lock.lrmod = mod;   /* exclusive (mod = 1) or shared (mod = 2)*/
      25:     bmove(&rtid, Lock.lrel, 4); /* copy relation id */
      26:     r = Lock.lpage;
      27:     for (i = 0; i < 4; i++)
      28:             /* zero out page id */
      29:         *r++ = 0;
      30:     i = write(Alockdes, &Lock, sizeof(struct lockreq));
      31:     return(i);
      32: }
      33: /*
      34:  *	unlrel- unlock a relation lock
      35:  */
      36: unlrl(rtid)
      37: long    rtid;
      38: {
      39:     register char   *r;
      40:     register int    i;
      41:
      42: #	ifdef xATR1
      43:     if (tTf(98,  5))
      44:         printf(" unlrl r=%s \n", locv(rtid));
      45: #	endif
      46:     if (Alockdes < 0)
      47:         return (1);
      48:     Lock.lract = A_RLS1;
      49:     Lock.lrtype = T_REL;    /* relation lock */
      50:     bmove(&rtid, Lock.lrel, 4); /* copy relation id */
      51:     r = Lock.lpage;
      52:     for (i = 0; i < 4; i++)
      53:             /* zero out pageid */
      54:         *r++ = 0;
      55:     i = write(Alockdes, &Lock, sizeof(struct lockreq));
      56:     return (i);
      57: }

#### Defined functions

setrll defined in line 8; used 9 times

- in /usr/ingres/source/dbu/copy.c line 212, 223
- in /usr/ingres/source/dbu/index.c line 161
- in /usr/ingres/source/dbu/modify.c line 199
- in /usr/ingres/source/dbu/print.c line 112
- in /usr/ingres/source/decomp/lockit.c line 69-73(2)
- in /usr/ingres/source/qrymod/d_prot.c line 267
- in /usr/ingres/source/qrymod/define.c line 223

unlrl defined in line 36; used 6 times

- in /usr/ingres/source/dbu/copy.c line 248
- in /usr/ingres/source/dbu/index.c line 210
- in /usr/ingres/source/dbu/modify.c line 251
- in /usr/ingres/source/dbu/print.c line 156
- in /usr/ingres/source/qrymod/d_prot.c line 289
- in /usr/ingres/source/qrymod/define.c line 251

#### Defined variables

Lock defined in line 3; used 11 times

- in line 22-30(6), 48-55(5)

Last modified: 1995-02-19 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 504 |