📄 lock.h
字号:
/*
* PROGRAM: JRD Lock Manager
* MODULE: lock.h
* DESCRIPTION: Lock manager structure definitions
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#ifndef _ISC_LOCK_LOCK_H_
#define _ISC_LOCK_LOCK_H_
#include <stdio.h>
#ifndef mpexl
#include <sys/types.h>
#if !(defined WIN_NT || defined OS2_ONLY)
#include <signal.h>
#ifndef NeXT
#if !(defined NETWARE_386 || defined WINDOWS_ONLY)
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#endif
#endif
#endif
#endif
#ifdef NeXT
#include <mach/cthreads.h>
#endif
#ifdef OS2_ONLY
#define INCL_DOSSEMAPHORES
#define INCL_DOSERRORS
#include <os2.h>
#endif
#ifdef WIN_NT
#include <windows.h>
#ifdef TEXT
#undef TEXT
#define TEXT SCHAR
#endif
#endif
#include "../jrd/common.h"
#include "../jrd/file_params.h"
#ifdef UNIX
#ifndef NeXT
#ifndef SOLARIS_MT
#if !(defined(HP10) && defined(SUPERSERVER))
#if !(defined(LINUX) && defined(SUPERSERVER))
#define MANAGER_PROCESS
#endif
#endif
#endif
#endif
#endif
#ifdef NeXT
#include "../jrd/isc_signal.h"
#endif
#ifdef OS2_ONLY
#define DEFAULT_SIZE 98304
#include "../jrd/isc_signal.h"
#endif
#ifdef WIN_NT
#define DEFAULT_SIZE 32768
#include "../jrd/isc_signal.h"
#endif
#ifdef mpexl
#define DEFAULT_SIZE 131072
#include "../jrd/isc_signal.h"
#endif
#ifdef NETWARE_386
#define DEFAULT_SIZE 131072
#define BLOCKING_SIGNAL 101
#endif
#ifdef WINDOWS_ONLY
#define DEFAULT_SIZE 64000
#define BLOCKING_SIGNAL 101
#endif
#ifndef BLOCKING_SIGNAL
#define BLOCKING_SIGNAL SIGUSR1
#endif
#ifndef DEFAULT_SIZE
#define DEFAULT_SIZE 98304
#endif
#ifndef EXTEND_SIZE
#define EXTEND_SIZE 32768
#endif
#ifdef EPSON
#define SEMAPHORES 10
#endif
#ifdef M88K
#define SEMAPHORES 10
#endif
#ifdef UNIXWARE
#define SEMAPHORES 10
#endif
#ifdef NCR3000
#define SEMAPHORES 25
#endif
#ifdef SCO_UNIX
#define SEMAPHORES 25
#endif
#ifdef sgi
#define SEMAPHORES 25
#endif
#ifdef IMP
#define SEMAPHORES 25
#endif
#ifdef DELTA
#define SEMAPHORES 25
#endif
#ifdef ultrix
#define SEMAPHORES 25
#endif
#ifdef DGUX
#define SEMAPHORES 25
#endif
#ifdef DECOSF
#define SEMAPHORES 16
#endif
#ifndef SEMAPHORES
#define SEMAPHORES 32
#endif
#undef BASE
#ifdef WINDOWS_ONLY
#define BASE ((UCHAR huge *) LOCK_header)
#define REL_PTR(item) (PTR) ((UCHAR huge *) item - BASE)
#define ABS_PTR(item) (BASE + item)
#else
#define BASE ((UCHAR*) LOCK_header)
#define REL_PTR(item) (PTR) ((UCHAR*) item - BASE)
#define ABS_PTR(item) (BASE + item)
#endif
#define QUE_INIT(que) {que.srq_forward = que.srq_backward = REL_PTR (&que);}
#define QUE_EMPTY(que) (que.srq_forward == REL_PTR (&que))
#define QUE_NEXT(que) (SRQ) ABS_PTR (que.srq_forward)
#define QUE_LOOP(header,que) for (que = QUE_NEXT (header);\
que != &header; que = QUE_NEXT ((*que)))
#define PTR SLONG
/* Maximum lock series for gathering statistics
and querying data */
#define LCK_MAX_SERIES 7
/* Lock query data aggregates */
#define LCK_MIN 1
#define LCK_MAX 2
#define LCK_CNT 3
#define LCK_SUM 4
#define LCK_AVG 5
#define LCK_ANY 6
/* Lock states */
#define LCK_none 0
#define LCK_null 1
#define LCK_SR 2 /* Shared Read */
#define LCK_PR 3 /* Protected Read */
#define LCK_SW 4 /* Shared Write */
#define LCK_PW 5 /* Protected Write */
#define LCK_EX 6 /* Exclusive */
#define LCK_max 7
/* Lock block types */
#define type_null 0
#define type_lhb 1
#define type_prb 2
#define type_lrq 3
#define type_lbl 4
#define type_his 5
#define type_smb 6
#define type_shb 7
#define type_own 8
#define type_MAX type_own
/* Self-relative que block. Offsets are from the block itself. */
typedef struct srq {
PTR srq_forward; /* Forward offset */
PTR srq_backward; /* Backward offset */
} *SRQ;
#define CLASSIC_LHB_VERSION 14
#define SS_LHB_VERSION (CLASSIC_LHB_VERSION + 100)
#ifdef SUPERSERVER
#define LHB_VERSION SS_LHB_VERSION
#else
#define LHB_VERSION CLASSIC_LHB_VERSION
#endif
#ifdef mpexl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -