コード例 #1
0
/*
 * Synchronous method function for
 * operation 'CEERCV_SystemMessage'
 */
extern "C" void
CEERCV_SystemMessage_sme_(
    /* In    */ CEE_tag_def objtag_
  , /* In    */ const CEE_handle_def *call_id_
  , /* Out   */ CEERCV_SystemMessage_exc_ *exception_
  , /* In    */ const FS_Receiveinfo_Type *receiveInfo
  , /* In    */ const CEERCV_SystemMessage_request_seq_ *request
  , /* Out   */ IDL_short *error
  , /* Out   */ CEERCV_SystemMessage_reply_seq_ *reply
  )
{
	exception_->exception_nr = CEERCV_SystemMessage_decline_exn_;
	*error = 0;
	reply->_length = 0;
	reply->_buffer = NULL;

	if( receiveInfo->io_type == 0 ) // System messages
	{
		if( request->_buffer[0] == XZSYS_VAL_SMSG_SHUTDOWN )
        {
           #if !defined(NSK_ODBC_SRVR) && !defined(NSK_CFGSRVR) && !defined(NSK_AS)
           file_mon_process_shutdown();
           exit(0);
           #endif

           #if defined(NSK_ODBC_SRVR) 
           terminateThreads(0);
           exit(0);
           #endif
           #if defined(NSK_AS)
           terminateThreads(0);
           file_mon_process_shutdown();
           exit(0);
           #endif           
        }
        else
		if( request->_buffer[0] == ZSYS_VAL_SMSG_PROCDEATH )
		{
			DISPATCH_PROCDEATH_SMessage( objtag_, call_id_, exception_, receiveInfo, request, error, reply );
		}
		else if( request->_buffer[0] == ZSYS_VAL_SMSG_CPUUP)
		{
			DISPATCH_CPUUP_SMessage( objtag_, call_id_, exception_, receiveInfo, request, error, reply );
		}
		else if( request->_buffer[0] == ZSYS_VAL_SMSG_CPUDOWN )
		{
			DISPATCH_CPUDOWN_SMessage( objtag_, call_id_, exception_, receiveInfo, request, error, reply );
		}
		else if( request->_buffer[0] == ZSYS_VAL_SMSG_OPEN ) 
		{
			DISPATCH_OPEN_SMessage( objtag_, call_id_, exception_, receiveInfo, request, error, reply );
		}
		else if( request->_buffer[0] == ZSYS_VAL_SMSG_CLOSE ) 
		{
			DISPATCH_CLOSE_SMessage( objtag_, call_id_, exception_, receiveInfo, request, error, reply );
		}
	}

}
コード例 #2
0
ファイル: Renderer.cpp プロジェクト: google/swiftshader
	Renderer::~Renderer()
	{
		sync->lock(EXCLUSIVE);
		sync->destruct();
		terminateThreads();
		sync->unlock();

		delete clipper;
		clipper = nullptr;

		delete blitter;
		blitter = nullptr;

		delete resumeApp;
		resumeApp = nullptr;

		for(int draw = 0; draw < DRAW_COUNT; draw++)
		{
			delete drawCall[draw];
			drawCall[draw] = nullptr;
		}

		delete swiftConfig;
		swiftConfig = nullptr;
	}
コード例 #3
0
ファイル: ise_server_udp.cpp プロジェクト: mfc10001/baoluo
//-----------------------------------------------------------------------------
// 描述: 根据负载情况动态调整线程数量
//-----------------------------------------------------------------------------
void UdpWorkerThreadPool::AdjustThreadCount()
{
    int packetCount, threadCount;
    int minThreads, maxThreads, deltaThreads;
    int packetAlertLine;

    // 取得线程数量上下限
    iseApp().iseOptions().getUdpWorkerThreadCount(
        ownGroup_->getGroupIndex(), minThreads, maxThreads);
    // 取得请求队列中数据包数量警戒线
    packetAlertLine = iseApp().iseOptions().getUdpRequestQueueAlertLine();

    // 检测线程是否工作超时
    checkThreadTimeout();
    // 强行杀死僵死的线程
    killZombieThreads();

    // 取得数据包数量和线程数量
    packetCount = ownGroup_->getRequestQueue().getCount();
    threadCount = threadList_.getCount();

    // 保证线程数量在上下限范围之内
    if (threadCount < minThreads)
    {
        createThreads(minThreads - threadCount);
        threadCount = minThreads;
    }
    if (threadCount > maxThreads)
    {
        terminateThreads(threadCount - maxThreads);
        threadCount = maxThreads;
    }

    // 如果请求队列中的数量超过警戒线,则尝试增加线程数量
    if (threadCount < maxThreads && packetCount >= packetAlertLine)
    {
        deltaThreads = ise::min(maxThreads - threadCount, 3);
        createThreads(deltaThreads);
    }

    // 如果请求队列为空,则尝试减少线程数量
    if (threadCount > minThreads && packetCount == 0)
    {
        deltaThreads = 1;
        terminateThreads(deltaThreads);
    }
}
コード例 #4
0
ファイル: android_init.c プロジェクト: KTaskn/MMDAgent
int _glfwPlatformTerminate( void )
{
#ifdef _GLFW_HAS_PTHREAD
    // Only the main thread is allowed to do this...
    if( pthread_self() != _glfwThrd.First.PosixID )
    {
        return GL_FALSE;
    }
#endif // _GLFW_HAS_PTHREAD

    // Close OpenGL window
    glfwCloseWindow();

    // Kill thread package
    terminateThreads();

    return GL_TRUE;
}
コード例 #5
0
ファイル: bk_planner.cpp プロジェクト: Aharobot/bk_nav
BKPlanner::~BKPlanner()
{
	terminateThreads();
}
コード例 #6
0
ファイル: Renderer.cpp プロジェクト: google/swiftshader
	void Renderer::updateConfiguration(bool initialUpdate)
	{
		bool newConfiguration = swiftConfig->hasNewConfiguration();

		if(newConfiguration || initialUpdate)
		{
			terminateThreads();

			SwiftConfig::Configuration configuration = {};
			swiftConfig->getConfiguration(configuration);

			precacheVertex = !newConfiguration && configuration.precache;
			precacheSetup = !newConfiguration && configuration.precache;
			precachePixel = !newConfiguration && configuration.precache;

			VertexProcessor::setRoutineCacheSize(configuration.vertexRoutineCacheSize);
			PixelProcessor::setRoutineCacheSize(configuration.pixelRoutineCacheSize);
			SetupProcessor::setRoutineCacheSize(configuration.setupRoutineCacheSize);

			switch(configuration.textureSampleQuality)
			{
			case 0:  Sampler::setFilterQuality(FILTER_POINT);       break;
			case 1:  Sampler::setFilterQuality(FILTER_LINEAR);      break;
			case 2:  Sampler::setFilterQuality(FILTER_ANISOTROPIC); break;
			default: Sampler::setFilterQuality(FILTER_ANISOTROPIC); break;
			}

			switch(configuration.mipmapQuality)
			{
			case 0:  Sampler::setMipmapQuality(MIPMAP_POINT);  break;
			case 1:  Sampler::setMipmapQuality(MIPMAP_LINEAR); break;
			default: Sampler::setMipmapQuality(MIPMAP_LINEAR); break;
			}

			setPerspectiveCorrection(configuration.perspectiveCorrection);

			switch(configuration.transcendentalPrecision)
			{
			case 0:
				logPrecision = APPROXIMATE;
				expPrecision = APPROXIMATE;
				rcpPrecision = APPROXIMATE;
				rsqPrecision = APPROXIMATE;
				break;
			case 1:
				logPrecision = PARTIAL;
				expPrecision = PARTIAL;
				rcpPrecision = PARTIAL;
				rsqPrecision = PARTIAL;
				break;
			case 2:
				logPrecision = ACCURATE;
				expPrecision = ACCURATE;
				rcpPrecision = ACCURATE;
				rsqPrecision = ACCURATE;
				break;
			case 3:
				logPrecision = WHQL;
				expPrecision = WHQL;
				rcpPrecision = WHQL;
				rsqPrecision = WHQL;
				break;
			case 4:
				logPrecision = IEEE;
				expPrecision = IEEE;
				rcpPrecision = IEEE;
				rsqPrecision = IEEE;
				break;
			default:
				logPrecision = ACCURATE;
				expPrecision = ACCURATE;
				rcpPrecision = ACCURATE;
				rsqPrecision = ACCURATE;
				break;
			}

			switch(configuration.transparencyAntialiasing)
			{
			case 0:  transparencyAntialiasing = TRANSPARENCY_NONE;              break;
			case 1:  transparencyAntialiasing = TRANSPARENCY_ALPHA_TO_COVERAGE; break;
			default: transparencyAntialiasing = TRANSPARENCY_NONE;              break;
			}

			switch(configuration.threadCount)
			{
			case -1: threadCount = CPUID::coreCount();        break;
			case 0:  threadCount = CPUID::processAffinity();  break;
			default: threadCount = configuration.threadCount; break;
			}

			CPUID::setEnableSSE4_1(configuration.enableSSE4_1);
			CPUID::setEnableSSSE3(configuration.enableSSSE3);
			CPUID::setEnableSSE3(configuration.enableSSE3);
			CPUID::setEnableSSE2(configuration.enableSSE2);
			CPUID::setEnableSSE(configuration.enableSSE);

			for(int pass = 0; pass < 10; pass++)
			{
				optimization[pass] = configuration.optimization[pass];
			}

			forceWindowed = configuration.forceWindowed;
			postBlendSRGB = configuration.postBlendSRGB;
			exactColorRounding = configuration.exactColorRounding;
			forceClearRegisters = configuration.forceClearRegisters;

		#ifndef NDEBUG
			minPrimitives = configuration.minPrimitives;
			maxPrimitives = configuration.maxPrimitives;
		#endif
		}

		if(!initialUpdate && !worker[0])
		{
			initializeThreads();
		}
	}