kernel/eka/kernel/sutils.cpp
branchRCL_3
changeset 42 a179b74831c9
parent 21 e7d2d738d3c2
child 43 c1f20ce4abcf
equal deleted inserted replaced
41:0ffb4e86fcc9 42:a179b74831c9
  3487 	return ETrue;
  3487 	return ETrue;
  3488 	}
  3488 	}
  3489 
  3489 
  3490 void TClientRequest::EndComplete(DThread* aThread)
  3490 void TClientRequest::EndComplete(DThread* aThread)
  3491 	{
  3491 	{
       
  3492 	// NB: if the callback is successfully queued, the target thread may run and
       
  3493 	// process it before we get back from the call to QueueUserModeCallback().
       
  3494 	// In that case, 'iStatus' will be changed; and in general it is not safe to
       
  3495 	// look at any element of 'this' once the callback is queued, as it may change
       
  3496 	// asynchronously.  Therefore, we must cache the value of 'iStatus' beforehand
       
  3497 	// and later use this saved copy to decide whether to signal the target thread.
       
  3498 	T_UintPtr status = iStatus;
  3492 	TInt r = NKern::QueueUserModeCallback(&aThread->iNThread, this);
  3499 	TInt r = NKern::QueueUserModeCallback(&aThread->iNThread, this);
       
  3500 
  3493 	if (r == KErrNone)
  3501 	if (r == KErrNone)
  3494 		{
  3502 		{
  3495 		if (iStatus != (KClientRequestNullStatus | KClientRequestFlagInUse))
  3503 		__NK_ASSERT_DEBUG(status & KClientRequestFlagInUse);
       
  3504 		if ((status & ~KClientRequestFlagInUse) != KClientRequestNullStatus)
  3496 			NKern::ThreadRequestSignal(&aThread->iNThread);
  3505 			NKern::ThreadRequestSignal(&aThread->iNThread);
  3497 		}
  3506 		}
  3498 	else
  3507 	else
  3499 		{
  3508 		{
  3500 		__NK_ASSERT_DEBUG(r == KErrDied);
  3509 		__NK_ASSERT_DEBUG(r == KErrDied);