pthread_t thread;
pthread_attr_t attrThread;
pthread_attr_init(&attrThread);
if ( 0 != pthread_create(&thread, &attrThread, ThreadFunc, NULL) )
{
return -1;
}
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_attr_destroy(&attrThread);
//信号量
sem_t g_csSend;
sem_init(&g_csSend, 0, 1);
sem_destroy(&g_csSend);
sem_wait(&g_csSend);
sem_post(&g_csSend);