Kaydet (Commit) 26821b7e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

tdf#84323: Make osl::Condition::wait more readable

Change-Id: Icd66ae1d390100549f903d45b2896cdcdca449be
üst 6b7c23b3
......@@ -21,6 +21,7 @@
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cstddef>
#include <cstring>
#include <map>
......@@ -854,11 +855,10 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize()
DBG( "%p pre-Player::getPreferredPlayerWindowSize, member %d x %d", this, mnWidth, mnHeight );
TimeValue aTimeout = { 10, 0 };
#if OSL_DEBUG_LEVEL > 2
osl::Condition::Result aResult =
#endif
maSizeCondition.wait( &aTimeout );
maSizeCondition.wait( std::chrono::seconds(10) );
DBG( "%p Player::getPreferredPlayerWindowSize after waitCondition %d, member %d x %d", this, aResult, mnWidth, mnHeight );
......
......@@ -18,6 +18,7 @@
*/
#include <boost/bind.hpp>
#include <chrono>
#include <iostream>
#include <osl/conditn.hxx>
#include <vcl/graph.hxx>
......@@ -85,9 +86,7 @@ VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString
mPlayer.setTime( ( fMediaTime > 0 ? fMediaTime : 0 ) * MSEC_IN_SEC );
mPlayer.pause();
const TimeValue timeout = {2, 0};
condition.wait(&timeout);
condition.wait(std::chrono::seconds(2));
if ( !mPlayer.hasVout() )
{
......
......@@ -80,6 +80,10 @@ namespace osl
return (Result) osl_waitCondition(condition, pTimeout);
}
#if defined LIBO_INTERNAL_ONLY
Result wait(TimeValue const & timeout) { return wait(&timeout); }
#endif
/** Checks if the condition is set without blocking.
*/
bool check()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment