⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 txn_stat.c

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 C
字号:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996-2002 *	Sleepycat Software.  All rights reserved. */#include "db_config.h"#ifndef lintstatic const char revid[] = "$Id: txn_stat.c,v 11.15 2002/04/26 23:00:36 bostic Exp $";#endif /* not lint */#ifndef NO_SYSTEM_INCLUDES#include <sys/types.h>#include <string.h>#endif#include "db_int.h"#include "dbinc/txn.h"/* * __txn_stat -- * * PUBLIC: int __txn_stat __P((DB_ENV *, DB_TXN_STAT **, u_int32_t)); */int__txn_stat(dbenv, statp, flags)	DB_ENV *dbenv;	DB_TXN_STAT **statp;	u_int32_t flags;{	DB_TXNMGR *mgr;	DB_TXNREGION *region;	DB_TXN_STAT *stats;	TXN_DETAIL *txnp;	size_t nbytes;	u_int32_t ndx;	int ret;	PANIC_CHECK(dbenv);	ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, "txn_stat", DB_INIT_TXN);	*statp = NULL;	if ((ret = __db_fchk(dbenv,	    "DB_ENV->txn_stat", flags, DB_STAT_CLEAR)) != 0)		return (ret);	mgr = dbenv->tx_handle;	region = mgr->reginfo.primary;	/*	 * Allocate for the maximum active transactions -- the DB_TXN_ACTIVE	 * struct is small and the maximum number of active transactions is	 * not going to be that large.  Don't have to lock anything to look	 * at the region's maximum active transactions value, it's read-only	 * and never changes after the region is created.	 */	nbytes = sizeof(DB_TXN_STAT) + sizeof(DB_TXN_ACTIVE) * region->maxtxns;	if ((ret = __os_umalloc(dbenv, nbytes, &stats)) != 0)		return (ret);	R_LOCK(dbenv, &mgr->reginfo);	memcpy(stats, &region->stat, sizeof(*stats));	stats->st_last_txnid = region->last_txnid;	stats->st_last_ckp = region->last_ckp;	stats->st_time_ckp = region->time_ckp;	stats->st_txnarray = (DB_TXN_ACTIVE *)&stats[1];	ndx = 0;	for (txnp = SH_TAILQ_FIRST(&region->active_txn, __txn_detail);	    txnp != NULL;	    txnp = SH_TAILQ_NEXT(txnp, links, __txn_detail)) {		stats->st_txnarray[ndx].txnid = txnp->txnid;		if (txnp->parent == INVALID_ROFF)			stats->st_txnarray[ndx].parentid = TXN_INVALID;		else			stats->st_txnarray[ndx].parentid =			    ((TXN_DETAIL *)R_ADDR(&mgr->reginfo,			    txnp->parent))->txnid;		stats->st_txnarray[ndx].lsn = txnp->begin_lsn;		ndx++;	}	stats->st_region_wait = mgr->reginfo.rp->mutex.mutex_set_wait;	stats->st_region_nowait = mgr->reginfo.rp->mutex.mutex_set_nowait;	stats->st_regsize = mgr->reginfo.rp->size;	if (LF_ISSET(DB_STAT_CLEAR)) {		mgr->reginfo.rp->mutex.mutex_set_wait = 0;		mgr->reginfo.rp->mutex.mutex_set_nowait = 0;		memset(&region->stat, 0, sizeof(region->stat));		region->stat.st_maxtxns = region->maxtxns;		region->stat.st_maxnactive =		    region->stat.st_nactive = stats->st_nactive;	}	R_UNLOCK(dbenv, &mgr->reginfo);	*statp = stats;	return (0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -