bluetoothmgmt/bluetoothclientlib/avctpservices/avctpremotedevices.cpp
changeset 51 20ac952a623c
parent 0 29b1cd4cb562
equal deleted inserted replaced
48:22de2e391156 51:20ac952a623c
    62 	iRefCount = 0;
    62 	iRefCount = 0;
    63 	}
    63 	}
    64 
    64 
    65 void RNestableLock::Wait()
    65 void RNestableLock::Wait()
    66 	{
    66 	{
    67 	iMetaLock.Wait();
    67     iMetaLock.Wait();
       
    68 
    68 	TThreadId currentThreadId = RThread().Id();
    69 	TThreadId currentThreadId = RThread().Id();
    69 	if(iThreadId == TThreadId(KInvalidThreadId) || currentThreadId != iThreadId)
    70 	if(iThreadId == TThreadId(KInvalidThreadId) || currentThreadId != iThreadId)
    70 		{
    71 		{
    71 		iMetaLock.Signal();
    72 		iMetaLock.Signal();
    72 		iLock.Wait();
    73 		iLock.Wait();
    73 		iMetaLock.Wait();
    74 		iMetaLock.Wait();
       
    75 		// 'currentThreadId' will be the thread Id of the thread running
       
    76 		// this bit of code. See comment above 'currentThreadId definition.
       
    77         // coverity[use]
    74 		iThreadId = currentThreadId;
    78 		iThreadId = currentThreadId;
    75 		}
    79 		}
    76 	++iRefCount;
    80 	++iRefCount;
    77 	iMetaLock.Signal();
    81 	iMetaLock.Signal();
       
    82 	// Coverity claims a missing unlock at the end of 
       
    83 	// this method. The missing unlock is from the 
       
    84 	// "iLock.Wait();" a few lines up.
       
    85     // However this method is intended to take the lock.
       
    86     // coverity[missing_unlock]
    78 	}
    87 	}
    79 
    88 
    80 void RNestableLock::Signal()
    89 void RNestableLock::Signal()
    81 	{
    90 	{
    82 	iMetaLock.Wait();
    91 	iMetaLock.Wait();