// we call WNE to allow tasks that own the resource the blue is waiting on system // task time, in case they are blocked on an ST remote call (or a memory allocation // for that matter). static void idle() { if(at_st()) { EventRecord sEvent; bool bEvent = WaitNextEvent(0U, &sEvent, 0UL, NULL); } }
delivery_man::delivery_man(): m_pPackage(NULL), m_pSemaphore(kInvalidID), m_bPackageWaiting(false) { assert(at_st()); OSStatus lStatus = MPCreateSemaphore(1UL, 0UL, &m_pSemaphore); // TODO - throw on error here assert(lStatus == noErr); }