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

📄 thread.c

📁 ok2440开发板带的linux下的应用程序实验
💻 C
字号:
#include<stdio.h>
#include<stddef.h>
#include<unistd.h>
#include<pthread.h>
thread1()
{
	printf("Iam the thread\n");
	sleep(1);
}
main()
{
	int ret;
	pthread_t id;
	ret=pthread_create(&id,NULL,(void*)thread1,NULL);
        if(ret!=0)
        {	
			printf("thread_send error\n");
			exit(1);
		}
        while(1)
        {
        printf("I am the main-thread\n");
        sleep(1);
        }
}

⌨️ 快捷键说明

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