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

📄 dllserver.cpp

📁 firtext搜索引擎源码
💻 CPP
字号:
#include "com/Com.h"
#include "com/comerror.h"
#include <assert.h>
#include <pthread.h>

static int32_t volatile lock_count = 0;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

FX_WINOLEAPI firtex::com::DllCanUnloadNowImpl()
{
	pthread_mutex_lock( &mutex );
	assert( lock_count >= 0 );
	int32_t tmp = lock_count;
	pthread_mutex_unlock( &mutex );

	return ( tmp > 0 ) ? FX_S_FALSE : FX_S_OK;
}

FX_WINOLEAPI firtex::com::DllLockServerImpl( int32_t fLock )
{
	pthread_mutex_lock( &mutex );
	assert( fLock || lock_count>0 );
	lock_count += fLock ? 1 : -1;
	assert( !fLock || lock_count>0 );
	pthread_mutex_unlock( &mutex );

	return FX_S_OK;
}

⌨️ 快捷键说明

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