+
+ IOLog("Attempting thread_call_allocate\n");
+ tcall2 = thread_call_allocate(thread_call_test_func2, this);
+ IOLog("thread_call_t %p\n", tcall);
+
+ tlock2 = IOLockAlloc();
+ IOLog("tlock2 %p\n", tlock2);
+
+ clock_interval_to_deadline(2, NSEC_PER_SEC, &deadline);
+ IOLog("%d sec deadline is %llu\n", 2, deadline);
+
+ ret = thread_call_enter_delayed(tcall2, deadline);
+
+ IOLockLock(tlock2);
+
+ clock_interval_to_deadline(3, NSEC_PER_SEC, &deadline);
+ IOLog("%d sec deadline is %llu\n", 3, deadline);
+ sleepret = IOLockSleepDeadline(tlock2, &my_event, deadline, THREAD_INTERRUPTIBLE);
+ IOLog("IOLockSleepDeadline(&my_event, %llu) returned %d, expected 0\n", deadline, sleepret);
+
+ IOLockUnlock(tlock2);
+
+ clock_interval_to_deadline(4, NSEC_PER_SEC, &deadline);
+ IOLog("%d sec deadline is %llu\n", 4, deadline);
+
+ ret = thread_call_enter_delayed(tcall2, deadline);
+
+ IOLockLock(tlock2);
+
+ clock_interval_to_deadline(3, NSEC_PER_SEC, &deadline);
+ IOLog("%d sec deadline is %llu\n", 3, deadline);
+ sleepret = IOLockSleepDeadline(tlock2, &my_event, deadline, THREAD_INTERRUPTIBLE);
+ IOLog("IOLockSleepDeadline(&my_event, %llu) returned %d, expected 1\n", deadline, sleepret);
+
+ IOLockUnlock(tlock2);