亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? multi.c

?? 關(guān)系型數(shù)據(jù)庫(kù) Postgresql 6.5.2
?? C
字號(hào):
/*------------------------------------------------------------------------- * * multi.c *	  multi level lock table manager * *	  Standard multi-level lock manager as per the Gray paper *	  (at least, that is what it is supposed to be).  We implement *	  three levels -- RELN, PAGE, TUPLE.  Tuple is actually TID *	  a physical record pointer.  It isn't an object id. * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION *	  $Header: /usr/local/cvsroot/pgsql/src/backend/storage/lmgr/multi.c,v 1.29 1999/05/25 16:11:22 momjian Exp $ * * NOTES: *	 (1) The lock.c module assumes that the caller here is doing *		 two phase locking. * *------------------------------------------------------------------------- */#include <stdio.h>#include <string.h>#include "postgres.h"#include "storage/lmgr.h"#include "storage/multilev.h"#include "utils/rel.h"#include "miscadmin.h"			/* MyDatabaseId */static bool MultiAcquire(LOCKMETHOD lockmethod, LOCKTAG *tag,			 LOCKMODE lockmode, PG_LOCK_LEVEL level);static bool MultiRelease(LOCKMETHOD lockmethod, LOCKTAG *tag,			 LOCKMODE lockmode, PG_LOCK_LEVEL level);/* * INTENT indicates to higher level that a lower level lock has been * set.  For example, a write lock on a tuple conflicts with a write * lock on a relation.	This conflict is detected as a WRITE_INTENT/ * WRITE conflict between the tuple's intent lock and the relation's * write lock. */static MASK MultiConflicts[] = {	(int) NULL,	/* All reads and writes at any level conflict with a write lock */	(1 << WRITE_LOCK) | (1 << WRITE_INTENT) | (1 << READ_LOCK) | (1 << READ_INTENT),	/* read locks conflict with write locks at curr and lower levels */	(1 << WRITE_LOCK) | (1 << WRITE_INTENT),	/* write intent locks */	(1 << READ_LOCK) | (1 << WRITE_LOCK),	/* read intent locks */	(1 << WRITE_LOCK),	/*	 * extend locks for archive storage manager conflict only w/extend	 * locks	 */	(1 << EXTEND_LOCK)};/* * write locks have higher priority than read locks and extend locks.  May * want to treat INTENT locks differently. */static int	MultiPrios[] = {	(int) NULL,	2,	1,	2,	1,	1};/* * Lock table identifier for this lock table.  The multi-level * lock table is ONE lock table, not three. */LOCKMETHOD	MultiTableId = (LOCKMETHOD) NULL;LOCKMETHOD	LongTermTableId = (LOCKMETHOD) NULL;#ifdef NOT_USEDLOCKMETHOD	ShortTermTableId = (LOCKMETHOD) NULL;#endif/* * Create the lock table described by MultiConflicts and Multiprio. */LOCKMETHODInitMultiLevelLocks(){	int			lockmethod;	lockmethod = LockMethodTableInit("MultiLevelLockTable",						  MultiConflicts, MultiPrios, MAX_LOCKMODES - 1);	MultiTableId = lockmethod;	if (!(MultiTableId))		elog(ERROR, "InitMultiLocks: couldnt initialize lock table");	/* -----------------------	 * No short term lock table for now.  -Jeff 15 July 1991	 *	 * ShortTermTableId = LockMethodTableRename(lockmethod);	 * if (! (ShortTermTableId)) {	 *	 elog(ERROR,"InitMultiLocks: couldnt rename lock table");	 * }	 * -----------------------	 */#ifdef USER_LOCKS	/*	 * Allocate another tableId for long-term locks	 */	LongTermTableId = LockMethodTableRename(MultiTableId);	if (!(LongTermTableId))	{		elog(ERROR,			 "InitMultiLevelLocks: couldn't rename long-term lock table");	}#endif	return MultiTableId;}/* * MultiLockReln -- lock a relation * * Returns: TRUE if the lock can be set, FALSE otherwise. */boolMultiLockReln(LockInfo lockinfo, LOCKMODE lockmode){	LOCKTAG		tag;	/*	 * LOCKTAG has two bytes of padding, unfortunately.  The hash function	 * will return miss if the padding bytes aren't zero'd.	 */	MemSet(&tag, 0, sizeof(tag));	tag.relId = lockinfo->lockRelId.relId;	tag.dbId = lockinfo->lockRelId.dbId;	return MultiAcquire(MultiTableId, &tag, lockmode, RELN_LEVEL);}#ifdef NOT_USED/* * MultiLockTuple -- Lock the TID associated with a tuple * * Returns: TRUE if lock is set, FALSE otherwise. * * Side Effects: causes intention level locks to be set *		at the page and relation level. */boolMultiLockTuple(LockInfo lockinfo, ItemPointer tidPtr, LOCKMODE lockmode){	LOCKTAG		tag;	/*	 * LOCKTAG has two bytes of padding, unfortunately.  The hash function	 * will return miss if the padding bytes aren't zero'd.	 */	MemSet(&tag, 0, sizeof(tag));	tag.relId = lockinfo->lockRelId.relId;	tag.dbId = lockinfo->lockRelId.dbId;	/* not locking any valid Tuple, just the page */	tag.tupleId = *tidPtr;	return MultiAcquire(MultiTableId, &tag, lockmode, TUPLE_LEVEL);}#endif/* * same as above at page level */boolMultiLockPage(LockInfo lockinfo, ItemPointer tidPtr, LOCKMODE lockmode){	LOCKTAG		tag;	/*	 * LOCKTAG has two bytes of padding, unfortunately.  The hash function	 * will return miss if the padding bytes aren't zero'd.	 */	MemSet(&tag, 0, sizeof(tag));	/* ----------------------------	 * Now we want to set the page offset to be invalid	 * and lock the block.	There is some confusion here as to what	 * a page is.  In Postgres a page is an 8k block, however this	 * block may be partitioned into many subpages which are sometimes	 * also called pages.  The term is overloaded, so don't be fooled	 * when we say lock the page we mean the 8k block. -Jeff 16 July 1991	 * ----------------------------	 */	tag.relId = lockinfo->lockRelId.relId;	tag.dbId = lockinfo->lockRelId.dbId;	BlockIdCopy(&(tag.tupleId.ip_blkid), &(tidPtr->ip_blkid));	return MultiAcquire(MultiTableId, &tag, lockmode, PAGE_LEVEL);}/* * MultiAcquire -- acquire multi level lock at requested level * * Returns: TRUE if lock is set, FALSE if not * Side Effects: */static boolMultiAcquire(LOCKMETHOD lockmethod,			 LOCKTAG *tag,			 LOCKMODE lockmode,			 PG_LOCK_LEVEL level){	LOCKMODE	locks[N_LEVELS];	int			i,				status;	LOCKTAG		xxTag,			   *tmpTag = &xxTag;	int			retStatus = TRUE;	/*	 * Three levels implemented.  If we set a low level (e.g. Tuple) lock,	 * we must set INTENT locks on the higher levels.  The intent lock	 * detects conflicts between the low level lock and an existing high	 * level lock.	For example, setting a write lock on a tuple in a	 * relation is disallowed if there is an existing read lock on the	 * entire relation.  The write lock would set a WRITE + INTENT lock on	 * the relation and that lock would conflict with the read.	 */	switch (level)	{		case RELN_LEVEL:			locks[0] = lockmode;			locks[1] = NO_LOCK;			locks[2] = NO_LOCK;			break;		case PAGE_LEVEL:			locks[0] = lockmode + INTENT;			locks[1] = lockmode;			locks[2] = NO_LOCK;			break;		case TUPLE_LEVEL:			locks[0] = lockmode + INTENT;			locks[1] = lockmode + INTENT;			locks[2] = lockmode;			break;		default:			elog(ERROR, "MultiAcquire: bad lock level");			return FALSE;	}	/*	 * construct a new tag as we go. Always loop through all levels, but	 * if we arent' seting a low level lock, locks[i] is set to NO_LOCK	 * for the lower levels.  Always start from the highest level and go	 * to the lowest level.	 */	MemSet(tmpTag, 0, sizeof(*tmpTag));	tmpTag->relId = tag->relId;	tmpTag->dbId = tag->dbId;	for (i = 0; i < N_LEVELS; i++)	{		if (locks[i] != NO_LOCK)		{			switch (i)			{				case RELN_LEVEL:					/* -------------					 * Set the block # and offset to invalid					 * -------------					 */					BlockIdSet(&(tmpTag->tupleId.ip_blkid), InvalidBlockNumber);					tmpTag->tupleId.ip_posid = InvalidOffsetNumber;					break;				case PAGE_LEVEL:					/* -------------					 * Copy the block #, set the offset to invalid					 * -------------					 */					BlockIdCopy(&(tmpTag->tupleId.ip_blkid),								&(tag->tupleId.ip_blkid));					tmpTag->tupleId.ip_posid = InvalidOffsetNumber;					break;				case TUPLE_LEVEL:					/* --------------					 * Copy the entire tuple id.					 * --------------					 */					ItemPointerCopy(&tmpTag->tupleId, &tag->tupleId);					break;			}			status = LockAcquire(lockmethod, tmpTag, locks[i]);			if (!status)			{				/*				 * failed for some reason. Before returning we have to				 * release all of the locks we just acquired.				 * MultiRelease(xx,xx,xx, i) means release starting from				 * the last level lock we successfully acquired				 */				retStatus = FALSE;				MultiRelease(lockmethod, tag, lockmode, i);				/* now leave the loop.	Don't try for any more locks */				break;			}		}	}	return retStatus;}/* ------------------ * Release a page in the multi-level lock table * ------------------ */#ifdef NOT_USEDboolMultiReleasePage(LockInfo lockinfo, ItemPointer tidPtr, LOCKMODE lockmode){	LOCKTAG		tag;	/* ------------------	 * LOCKTAG has two bytes of padding, unfortunately.  The	 * hash function will return miss if the padding bytes aren't	 * zero'd.	 * ------------------	 */	MemSet(&tag, 0, sizeof(LOCKTAG));	tag.relId = lockinfo->lockRelId.relId;	tag.dbId = lockinfo->lockRelId.dbId;	BlockIdCopy(&(tag.tupleId.ip_blkid), &(tidPtr->ip_blkid));	return MultiRelease(MultiTableId, &tag, lockmode, PAGE_LEVEL);}#endif/* ------------------ * Release a relation in the multi-level lock table * ------------------ */boolMultiReleaseReln(LockInfo lockinfo, LOCKMODE lockmode){	LOCKTAG		tag;	/* ------------------	 * LOCKTAG has two bytes of padding, unfortunately.  The	 * hash function will return miss if the padding bytes aren't	 * zero'd.	 * ------------------	 */	MemSet(&tag, 0, sizeof(LOCKTAG));	tag.relId = lockinfo->lockRelId.relId;	tag.dbId = lockinfo->lockRelId.dbId;	return MultiRelease(MultiTableId, &tag, lockmode, RELN_LEVEL);}/* * MultiRelease -- release a multi-level lock * * Returns: TRUE if successful, FALSE otherwise. */static boolMultiRelease(LOCKMETHOD lockmethod,			 LOCKTAG *tag,			 LOCKMODE lockmode,			 PG_LOCK_LEVEL level){	LOCKMODE	locks[N_LEVELS];	int			i,				status;	LOCKTAG		xxTag,			   *tmpTag = &xxTag;	/*	 * same level scheme as MultiAcquire().	 */	switch (level)	{		case RELN_LEVEL:			locks[0] = lockmode;			locks[1] = NO_LOCK;			locks[2] = NO_LOCK;			break;		case PAGE_LEVEL:			locks[0] = lockmode + INTENT;			locks[1] = lockmode;			locks[2] = NO_LOCK;			break;		case TUPLE_LEVEL:			locks[0] = lockmode + INTENT;			locks[1] = lockmode + INTENT;			locks[2] = lockmode;			break;		default:			elog(ERROR, "MultiRelease: bad lockmode");	}	/*	 * again, construct the tag on the fly.  This time, however, we	 * release the locks in the REVERSE order -- from lowest level to	 * highest level.	 *	 * Must zero out the tag to set padding byes to zero and ensure hashing	 * consistency.	 */	MemSet(tmpTag, 0, sizeof(*tmpTag));	tmpTag->relId = tag->relId;	tmpTag->dbId = tag->dbId;	for (i = (N_LEVELS - 1); i >= 0; i--)	{		if (locks[i] != NO_LOCK)		{			switch (i)			{				case RELN_LEVEL:					/* -------------					 * Set the block # and offset to invalid					 * -------------					 */					BlockIdSet(&(tmpTag->tupleId.ip_blkid), InvalidBlockNumber);					tmpTag->tupleId.ip_posid = InvalidOffsetNumber;					break;				case PAGE_LEVEL:					/* -------------					 * Copy the block #, set the offset to invalid					 * -------------					 */					BlockIdCopy(&(tmpTag->tupleId.ip_blkid),								&(tag->tupleId.ip_blkid));					tmpTag->tupleId.ip_posid = InvalidOffsetNumber;					break;				case TUPLE_LEVEL:					ItemPointerCopy(&tmpTag->tupleId, &tag->tupleId);					break;			}			status = LockRelease(lockmethod, tmpTag, locks[i]);			if (!status)				elog(ERROR, "MultiRelease: couldn't release after error");		}	}	/* shouldn't reach here */	return false;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美成人午夜| 奇米777欧美一区二区| 久久综合久久鬼色| 欧美精品v国产精品v日韩精品| 91福利在线看| 欧美日韩亚洲综合一区| 欧美日韩综合色| 欧美老女人在线| 日韩精品一区二区三区三区免费| 91精品国产aⅴ一区二区| 7777女厕盗摄久久久| 欧美一区二区人人喊爽| 日韩欧美黄色影院| 久久久久久久久免费| 国产女人18毛片水真多成人如厕| 国产精品视频免费| 亚洲男人的天堂在线aⅴ视频| 亚洲欧美精品午睡沙发| 亚洲精品国产成人久久av盗摄 | 久久综合久久综合久久综合| 精品动漫一区二区三区在线观看| 欧美第一区第二区| 久久久久久久一区| 中文字幕日韩一区| 亚洲福利一二三区| 麻豆极品一区二区三区| 国产精品一线二线三线精华| 成人性生交大片免费| 99国产精品99久久久久久| 在线看国产一区二区| 欧美电影一区二区三区| 2021中文字幕一区亚洲| 日韩美女精品在线| 亚洲v日本v欧美v久久精品| 麻豆成人免费电影| 成人免费视频一区| 91国模大尺度私拍在线视频| 91精品国产一区二区三区蜜臀| 久久久久久久久久久黄色| 国产精品成人一区二区艾草| 亚洲成人一区二区在线观看| 激情欧美日韩一区二区| 国产精品一区二区在线观看不卡 | 欧美喷潮久久久xxxxx| 精品国产麻豆免费人成网站| 国产人成一区二区三区影院| 夜夜夜精品看看| 国产一区二区在线看| 成人精品gif动图一区| 欧美日韩一区二区三区在线 | 久热成人在线视频| 91免费小视频| 久久亚洲精华国产精华液| 一区二区三区欧美视频| 91精品国产综合久久久久久漫画| 久久影音资源网| 亚洲国产精品久久久久秋霞影院| 国产精品亚洲一区二区三区在线 | 91久久国产最好的精华液| 欧美电视剧免费全集观看| 一区二区免费在线| 国产成人午夜高潮毛片| 91精品国产福利| 亚洲一区免费观看| 成人性色生活片| 欧美大片拔萝卜| 亚洲在线成人精品| 成人ar影院免费观看视频| 欧美一区二区三区不卡| 亚洲一区二区三区自拍| 国产成人在线看| 日韩欧美中文一区| 亚洲另类中文字| 不卡视频一二三| 久久久久久**毛片大全| 久久精品国产一区二区三| 欧美在线观看视频在线| 中文字幕制服丝袜一区二区三区 | 欧美一区欧美二区| 亚洲综合在线第一页| 成人av中文字幕| 国产日韩三级在线| 国产精品996| 欧美tk丨vk视频| 蜜臂av日日欢夜夜爽一区| 欧美在线看片a免费观看| 日韩毛片在线免费观看| 成人午夜电影网站| 国产视频视频一区| 国内外精品视频| 精品粉嫩超白一线天av| 免费观看30秒视频久久| 91精品在线观看入口| 午夜一区二区三区视频| 在线观看av一区二区| 亚洲精品成人少妇| 色婷婷久久一区二区三区麻豆| 国产精品国产馆在线真实露脸| 国产一区二区在线影院| 久久久久久99精品| 国产麻豆精品在线| 国产视频一区二区三区在线观看| 精品一区二区三区在线播放 | 亚洲一二三级电影| 欧美色精品在线视频| 一区二区不卡在线视频 午夜欧美不卡在 | 捆绑变态av一区二区三区| 日韩亚洲欧美成人一区| 美女诱惑一区二区| 欧美刺激脚交jootjob| 麻豆国产一区二区| 久久夜色精品国产噜噜av | 日日夜夜免费精品| 欧美一区二区高清| 国产专区综合网| 中文字幕免费观看一区| 91在线观看地址| 亚洲福利视频三区| 日韩午夜精品视频| 国产精品白丝jk白祙喷水网站| 国产精品午夜电影| 在线免费观看不卡av| 婷婷成人综合网| 欧美tickling挠脚心丨vk| 国产成人av电影在线| 亚洲欧洲日韩一区二区三区| 在线视频欧美区| 麻豆免费看一区二区三区| www国产成人免费观看视频 深夜成人网| 国产精品一区二区三区四区| 国产精品久久精品日日| 欧美婷婷六月丁香综合色| 日韩av电影天堂| 国产女人18水真多18精品一级做 | 日韩美女一区二区三区四区| 国产一区二区伦理片| 丁香激情综合五月| 亚洲一区在线视频观看| 日韩女优av电影在线观看| 国产电影一区在线| 亚洲综合色视频| 欧美va亚洲va| 在线中文字幕一区| 久久国产婷婷国产香蕉| 日韩美女啊v在线免费观看| 欧美精品久久一区| 国产一区二区三区在线观看免费 | 日韩精品五月天| 国产欧美视频一区二区| 欧美在线|欧美| 国产精品一区二区无线| 亚洲自拍偷拍欧美| 国产欧美精品一区二区三区四区| 欧美最猛性xxxxx直播| 国产一区二区三区av电影| 一二三四社区欧美黄| 久久久.com| 欧美女孩性生活视频| 成人av在线观| 美日韩黄色大片| 亚洲一区在线看| 欧美激情在线一区二区| 911国产精品| 色婷婷国产精品| 国产大陆a不卡| 秋霞午夜鲁丝一区二区老狼| 日韩一区欧美小说| 久久在线观看免费| 91精品国产一区二区三区| 色综合天天性综合| 国产一区二区免费看| 喷白浆一区二区| 亚洲综合在线五月| 亚洲欧洲成人自拍| 亚洲精品一区二区三区99 | 亚洲成a人片在线观看中文| 中文av一区特黄| 26uuu亚洲| 91麻豆精品国产91久久久资源速度| 成人ar影院免费观看视频| 国产美女精品一区二区三区| 日本午夜一本久久久综合| 最近中文字幕一区二区三区| 欧美国产综合色视频| 精品乱人伦小说| 3atv一区二区三区| 欧美性受xxxx黑人xyx| 91蝌蚪porny九色| 成人午夜av在线| 成人一区二区三区视频在线观看| 免费在线看成人av| 日本欧美肥老太交大片| 亚洲综合区在线| 亚洲理论在线观看| 亚洲婷婷国产精品电影人久久| 中文文精品字幕一区二区| 久久久久久久久97黄色工厂| 精品国产91亚洲一区二区三区婷婷| 欧美一区二区性放荡片| 欧美日韩成人在线一区|