📄 thread.c
字号:
#include <pthread.h>#include <stdio.h>//#define NULL 0void *threadA(void *arc){ while(1) { printf("hello threadA\n"); sleep(2); }}void *threadB(void *arc){ while(1) { printf("hello threadB\n"); sleep(2222222222222222222222main(){ pthread_t threadidA, threadidB; pthread_create(&threadidA, NULL, &threadA, NULL); pthread_create(&threadidB, NULL, &threadB, NULL); // pthread_create(NULL, NULL, NULL, NULL); while(1) { sleep(1); printf("main test\n"); } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -