多线程编程指南

进程内信号

#include <thread.h>



sema_t sp;

int ret;

int count;

count = 4;



/* to be used within this process only */

ret = sema_init(&sp, count, USYNC_THREAD, 0);