Hi. I'm porting some driver code from Linux, and having trouble using the wait_queue API (in kern/wait_queue.h). I use "wq = wait_queue_alloc(SYNC_POLICY_FIFO);" to set things up, "wait_queue_assert_wait(&wq, NO_EVENT, THREAD_INTERRUPTIBLE)" to add my single thread to the queue, and wakeup_one to wake it up. It looks like my driver is locking the machine in a loop containing the assert_wait() call: while (1) { ..check if there's data ready to be processed.. ..if so, break ..else, assert_wait } The waiting thread is only woken up by me when new data is ready to be processed, and yet execution in this thread never leaves that loop. I haven't been able to find much information on wait_queues. Is there something obvious I'm missing about their initialization or use? Thanks, Vivek _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Vivek Balasubramanyam