File: btmutex.c

package info (click to toggle)
db5.3 5.3.28%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 158,500 kB
  • sloc: ansic: 448,411; java: 111,824; tcl: 80,544; sh: 44,264; cs: 33,697; cpp: 21,604; perl: 14,557; xml: 10,799; makefile: 4,077; javascript: 1,998; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (84 lines) | stat: -rw-r--r-- 1,795 bytes parent folder | download | duplicates (7)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2010, 2013 Oracle and/or its affiliates.  All rights reserved.
 */

/*
** This file contains code used to implement mutexes on Btree objects.
** This code really belongs in btree.c.  But btree.c is getting too
** big and we want to break it down some.  This packaged seemed like
** a good breakout.
*/
#include "btreeInt.h"
#ifndef SQLITE_OMIT_SHARED_CACHE
/*
 * Berkeley DB does fine grained locking - disable the SQLite table level
 * locking.
 */
void sqlite3BtreeEnter(Btree *p)
{
}

void sqlite3BtreeLeave(Btree *p)
{
}

void sqlite3BtreeEnterCursor(BtCursor *pCur)
{
}

void sqlite3BtreeLeaveCursor(BtCursor *pCur)
{
}

void sqlite3BtreeEnterAll(sqlite3 *db)
{
}

void sqlite3BtreeLeaveAll(sqlite3 *db)
{
}

int sqlite3BtreeHoldsMutex(Btree *db)
{
	log_msg(LOG_VERBOSE, "sqlite3BtreeHoldsMutex(%p)", db);
	return 1;
}

int sqlite3BtreeHoldsAllMutexes(sqlite3 *db)
{
	log_msg(LOG_VERBOSE, "sqlite3BtreeHoldsAllMutexes(%p)", db);
	return 1;
}

int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema)
{
	/*
	 * Berkeley DB SQL uses different locking semantics to SQLite. This
	 * function is only used to verify that a lock is held. Always return
	 * true. Some test fail if this is implemented using the following code
	 * which is based on the implementation in SQLite.
	 *
	Btree *p;

	assert(db != 0);
	if (pSchema)
		iDb = sqlite3SchemaToIndex(db, pSchema);
	assert(iDb >= 0 && iDb < db->nDb);
	if (sqlite3_mutex_held(db->mutex) != 0)
		return 0;
	if (iDb == 1)
		return 1;
	p = db->aDb[iDb].pBt;
	assert(p != 0);
	return (p->sharable == 0 || p->schemaLockMode != LOCKMODE_NONE);
	*/
	return (1);
}

int sqlite3BtreeSharable(Btree *p)
{
	return (1);
}
#endif /* ifndef SQLITE_OMIT_SHARED_CACHE */