site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Icedove 1.5.0.9 (X11/20061220) Anton,
Indeed, sched_yield() calls the swtch_pri() system call with zero as only argument (the argument is not used by swtch_pri() so it does not matter anyway). That in turn is connected to thread_block_reason() which you cannot call form a kext but that is called from thread_block() which I suggested to you in my previous email so my answer of using thread_block(THREAD_CONTINUE_NULL) may well turn out to be a winner here!
I did the same investigation, but came to a different conclusion: swtch_pri actually uses thread_block_reason(THREAD_CONTINUE_NULL, NULL, AST_YIELD) and the only difference is that: 1) thread_block_reason is not exported 2) AST_YIELD forces the timeslice of the current thread to 0 So by just using thread_block(), we might not surrender the timeslice. I'll do some more real-life testing. -- hpreg _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com