int mFileDescriptor; ///< DRM dev node file descriptor
drmVBlank mVBlankInfo;
- bool mUseHardwareVSync; ///< Whether to use hardware vsync
- bool mHardwareVSyncAvailable; ///< Whether hardware vsync is available
+ // NOTE cannot use booleans as these are used from multiple threads, must use variable with machine word size for atomic read/write
+ unsigned int mUseHardwareVSync; ///< Whether to use hardware vsync
+ unsigned int mHardwareVSyncAvailable; ///< Whether hardware vsync is available
};
} // namespace Adaptor
namespace
{
+// constants to keep code readability with unsigned int has to be used as boolean (due to multithreading)
+const unsigned int TRUE = 1u;
+const unsigned int FALSE = 0u;
#if defined(DEBUG_ENABLED)
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VSYNC_MONITOR");
// - VCONFKEY_PM_STATE_LCDDIM : turn vsync off
// - VCONFKEY_PM_STATE_LCDOFF : turn vsync off
// - VCONFKEY_PM_STATE_SLEEP : turn vsync off
- const bool screenOn( VCONFKEY_PM_STATE_NORMAL == status );
+ const unsigned int screenOn( VCONFKEY_PM_STATE_NORMAL == status );
vsyncMonitor->SetHardwareVSyncAvailable( screenOn );
VSyncMonitor::VSyncMonitor()
: mFileDescriptor( FD_NONE ),
- mUseHardwareVSync( true ),
- mHardwareVSyncAvailable( false )
+ mUseHardwareVSync( TRUE ),
+ mHardwareVSyncAvailable( FALSE )
{
vconf_notify_key_changed( VCONFKEY_PM_STATE, ScreenStatusChanged, this );
}
namespace
{
+// constants to keep code readability with unsigned int has to be used as boolean (due to multithreading)
+const unsigned int TRUE = 1u;
+const unsigned int FALSE = 0u;
const int FD_NONE( -1 );
VSyncMonitor::VSyncMonitor()
: mFileDescriptor( FD_NONE ),
- mUseHardwareVSync( false ),
- mHardwareVSyncAvailable( false )
+ mUseHardwareVSync( FALSE ),
+ mHardwareVSyncAvailable( FALSE )
{
}