📄 thread.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 + -