Replace manual Mutex handling by clearable guard
Change-Id: I4c20bf3a2aa5ca908db233e54f50404cc7466d72
This commit is contained in:
parent
43f9468d35
commit
475bafc4be
1 changed files with 2 additions and 6 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue