test3.c

来自「用于移植在pthread环境中开发的应用程序到没有pthread支持的环境」· C语言 代码 · 共 35 行

C
35
字号
/* test if there is error when a null recycle thread(task) running
 * responding to the SCTP's  <sctp_eshell_> thread's error, number 3d0002
 */

#include "test_i.h"

void *cld1_3( void *p )
{
	struct timespec t;
	
	printf("Entering cld1_4....\n");
	
	t.tv_sec = 2;
	t.tv_nsec = 0;
	
	for(;;)
	{
		pthread_delay_np( &t );
	}
}

int test3( void )
{
	pthread_t idThread;
		
	if( pthread_create( &idThread, 0, cld1_3, NULL, 0) == PTHR_FAILURE)
	{
		printf("ERROR: create thr error\n");
	}
	else
	{
		printf("creat thr succ\n");
	}
}
 

⌨️ 快捷键说明

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