Replace manual Mutex handling by clearable guard

Change-Id: I4c20bf3a2aa5ca908db233e54f50404cc7466d72
This commit is contained in:
Lionel Elie Mamane 2012-02-22 06:53:51 +01:00
parent 43f9468d35
commit 475bafc4be

View file

@ -222,28 +222,24 @@ MQueryHelper::getByIndex( sal_uInt32 nRow )
}
do {
// Obtain the Mutex - don't use a guard as we want to be able to release
// and acquire again...
m_aMutex.acquire();
::osl::ClearableMutexGuard aGuard( m_aMutex );
if ( nRow > m_aResults.size() )
{
if ( m_bQueryComplete )
{
m_bAtEnd = sal_True;
m_aMutex.release();
return( NULL );
}
else
{
clearResultOrComplete();
m_aMutex.release();
aGuard.clear();
if ( !waitForResultOrComplete( ) )
return( NULL );
}
}
else
{
m_aMutex.release();
return( m_aResults[ nRow -1 ] );
}
} while ( sal_True );