Can someone explain me why I got a "Illegal Instruction" exception when executing the following code (whatever the arch is).
I'm trying to update code based on mach semaphore, and this is one of my unit test (which works fine with mach semaphore).
-----------------------------------
#include <dispatch/dispatch.h>
int main(int argc, char **argv) {
dispatch_semaphore_t ds = dispatch_semaphore_create(1);
dispatch_semaphore_wait(ds, DISPATCH_TIME_NOW); // count is 0
dispatch_semaphore_wait(ds, DISPATCH_TIME_NOW); // timeout
dispatch_semaphore_signal(ds); // count is 1
dispatch_semaphore_wait(ds, DISPATCH_TIME_NOW); // count is 0
dispatch_release(ds); // crash
return 0;
}
-----------------------------------
Thanks
-- Jean-Daniel