void COMPLETION_PORT_IMPL::CheckWaiters() { // start the first waiter COMPLETION_WAITER *waiter = waiter_list.Head(); assert( waiter ); StartWaiter( waiter ); }
void CSenUnderTakerWaiter::RunL() { if(iStatus == KErrDied) { RThread th; th.SetHandle(iDyingThreadNumber); TFullName name = th.FullName(); TExitType type = th.ExitType(); if(iDispatcherThreadID == th.Id()) { //Notifies client that thread is died. Client has to restart the //connection here.In this case client has to create new SC object. if(type == EExitKill) { if(iSenServiceConnectionImpl) { iSenServiceConnectionImpl->iErrorNumber = EExitKill; iSenServiceConnectionImpl->iTxnId = -1; iSenServiceConnectionImpl->HandleMessageFromChildAOL(iStatus.Int()); } } else // panic { TExitCategoryName categ = th.ExitCategory(); if(iSenServiceConnectionImpl) { iSenServiceConnectionImpl->iErrorNumber = EExitPanic; iSenServiceConnectionImpl->iTxnId = -1; iSenServiceConnectionImpl->HandleMessageFromChildAOL(iStatus.Int()); } } } th.Close(); StartWaiter(); } }
void COMPLETION_PORT_IMPL::Set(ULONG key, ULONG value, NTSTATUS status, ULONG info) { COMPLETION_PACKET *packet; packet = new COMPLETION_PACKET( key, value, status, info ); queue.Append( packet ); // queue a packet if there's no waiting thread COMPLETION_WAITER *waiter = waiter_list.Head(); if (!waiter) return; // give each thread an I/O completion packet // and add it to the list of idle threads if (RUNLIST_ENTRY::NumActiveThreads() >= num_threads ) { PortWaitIdle(); return; } // there should only be one packet in the queue here StartWaiter( waiter ); assert( queue.Empty() ); }