Kaydet (Commit) b450a328 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

create a class SolarMutexGuard to take a Guard on the SolarMutex

Most user of OGuard, use it to guard the SolarMutex.
using something like
vos::OGuard aGuard(Application::GetSolarMutex())

Which will now be written
vcl::SolarMutexGuard aGuard;

This will also, as a side effect remove the use of vos::Guard in many
sources, simplifying the migration out of ::vos
üst 5baa9a51
......@@ -498,6 +498,31 @@ private:
DECL_STATIC_LINK( Application, PostEventHandler, void* );
};
class VCL_DLLPUBLIC SolarMutexGuard
{
private:
SolarMutexGuard( const SolarMutexGuard& );
const SolarMutexGuard& operator = ( const SolarMutexGuard& );
::vos::IMutex& m_solarMutex;
public:
/** Acquires the object specified as parameter.
*/
SolarMutexGuard() :
m_solarMutex(Application::GetSolarMutex())
{
m_solarMutex.acquire();
}
/** Releases the mutex or interface. */
~SolarMutexGuard()
{
m_solarMutex.release();
}
};
/**
A helper class that calls Application::ReleaseSolarMutex() in its constructor
and restores the mutex in its destructor.
......
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