【发布时间】:2011-08-10 03:11:35
【问题描述】:
谁能告诉我为什么我这里有分段错误?
void *dispatcher_threadloop(void * queue){
//thread loop of the dispatch thread- pass the tast to one of worker thread
dispatch_queue_t *dQueue;
printf("message-boss1");
dQueue = (dispatch_queue_t *)queue;
if (dQueue->HEAD!=NULL){
for(;;){
sem_wait(dQueue->queue_thread_semaphore);
//TODO
}
}
printf("message-boss2");
}
【问题讨论】:
-
你试过使用调试器吗?
标签: c if-statement segmentation-fault