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

📄 connectioncount.c

📁 适合于Unix/Linux下的一个持久数据库连接池
💻 C
字号:
// Copyright (c) 1999-2004  David Muse// See the file COPYING for more information#include <sqlrconnection.h>void sqlrconnection_svr::incrementConnectionCount() {	#ifdef SERVER_DEBUG	debugPrint("connection",0,"incrementing connection count...");	#endif	acquireConnectionCountMutex();	// increment the counter	uint32_t	*connectioncount=getConnectionCountBuffer();	(*connectioncount)++;	decrementonclose=true;	#ifdef SERVER_DEBUG	debugPrint("connection",1,(int32_t)(*connectioncount));	#endif	signalScalerToRead();	releaseConnectionCountMutex();	#ifdef SERVER_DEBUG	debugPrint("connection",0,"done incrementing connection count");	#endif}void sqlrconnection_svr::decrementConnectionCount() {	#ifdef SERVER_DEBUG	debugPrint("connection",0,"decrementing connection count...");	#endif	acquireConnectionCountMutex();	// decrement the counter	uint32_t	*connectioncount=getConnectionCountBuffer();	(*connectioncount)--;	if ((*connectioncount)<0) {		(*connectioncount)=0;	}	decrementonclose=false;	#ifdef SERVER_DEBUG	debugPrint("connection",1,(int32_t)(*connectioncount));	#endif	releaseConnectionCountMutex();	#ifdef SERVER_DEBUG	debugPrint("connection",0,"done decrementing connection count");	#endif}void sqlrconnection_svr::decrementSessionCount() {	#ifdef SERVER_DEBUG	debugPrint("connection",0,"decrementing session count...");	#endif	acquireSessionCountMutex();	// decrement the counter	uint32_t	*sessioncount=getSessionCountBuffer();	(*sessioncount)--;	#ifdef SERVER_DEBUG	debugPrint("connection",1,(int32_t)(*sessioncount));	#endif	releaseSessionCountMutex();	#ifdef SERVER_DEBUG	debugPrint("connection",0,"done decrementing session count");	#endif}

⌨️ 快捷键说明

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