?? test02.c
字號:
#include "unpthread.h"void *myfunc(void *ptr){ int val; printf("thread ID of myfunc: %d\n", pthread_self()); val = *((int *) ptr); printf("val = %d\n", val); sleep(10); val = *((int *) ptr); printf("val = %d\n", val);}intmain(int argc, char **argv){ pthread_t tid; int n, val; printf("thread ID of main: %d\n", pthread_self()); /* Let's verify that the value pointed to the thread's argument is modifiable */ val = 123; if ( (n = pthread_create(&tid, NULL, myfunc, &val)) != 0) errno = n, err_sys("pthread_create error"); sleep(5); val = 789; sleep(20); exit(0);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -