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

📄 step10.cpp

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 CPP
字号:

/*
 * Step10:
 * Program exit by killing main thread, check also stack unwinding.
 */

#include <iostream.h>
#include <stdlib.h>

#include "PiAPI.h"
#include "TestOS.h"

int iRet;

void Step10()
{
	iRet = -1;
	PISync *pSema = PIPlatform_allocLocalSemaphore( 1, 1 );
	if ( !pSema )
		{ FAILED(1); return; };
	if ( PISync_lock( pSema ) ) 
		{ FAILED(2); return; };
	if ( PISync_unlock( pSema ) ) 
		{ FAILED(3); return; };
	if ( PISync_delete( pSema ) )
		{ FAILED(4); return; };
	iRet = 0;
	OK;
}

int main()
{
	if ( PIPlatform_enter( "dummy", PIPLATFORM_VERSION_1_0, Step10 ) )
		{
		cout << "Platform_enter() failed." << endl;
		FAILED(99);
		exit( 1 );
		};

	return iRet;
}

⌨️ 快捷键说明

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