aboutsummaryrefslogtreecommitdiff
path: root/db2/lock/lock_conflict.c
blob: ff0287f07e1335c1c8304d005914fa7240c7120b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 1996, 1997
 *	Sleepycat Software.  All rights reserved.
 */

#include "config.h"

#ifndef lint
static const char sccsid[] = "@(#)lock_conflict.c	10.2 (Sleepycat) 6/21/97";
#endif /* not lint */

#ifndef NO_SYSTEM_INCLUDES
#include <sys/types.h>
#endif

#include "db_int.h"

/*
 * The conflict arrays are set up such that the row is the lock you
 * are holding and the column is the lock that is desired.
 */
const u_int8_t db_rw_conflicts[] = {
	/*		N   R   W */
	/*   N */	0,  0,  0,
	/*   R */	0,  0,  1,
	/*   W */	0,  1,  1
};

const u_int8_t db_riw_conflicts[] = {
	/*		N   	S   	X  	IS  	IX	SIX */
	/*   N */	0,	0,	0,	0,	0,	0,
	/*   S */	0,	0,	1,	0,	1,	1,
	/*   X */	1,	1,	1,	1,	1,	1,
	/*  IS */	0,	0,	1,	0,	0,	0,
	/*  IX */	0,	1,	1,	0,	0,	0,
	/* SIX */	0,	1,	1,	0,	0,	0
};