mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
[master clock] Fix MT safety issues
Fix MT issues when enabling threading in Clutter. Fixes bug: http://bugzilla.openedhand.com/show_bug.cgi?id=1655 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
ba6c0c27f9
commit
c272a7b2a2
@ -212,7 +212,9 @@ clutter_clock_prepare (GSource *source,
|
||||
ClutterMasterClock *master_clock = clock_source->master_clock;
|
||||
int delay;
|
||||
|
||||
clutter_threads_enter ();
|
||||
delay = master_clock_next_frame_delay (master_clock);
|
||||
clutter_threads_leave ();
|
||||
|
||||
*timeout = delay;
|
||||
|
||||
@ -226,7 +228,9 @@ clutter_clock_check (GSource *source)
|
||||
ClutterMasterClock *master_clock = clock_source->master_clock;
|
||||
int delay;
|
||||
|
||||
clutter_threads_enter ();
|
||||
delay = master_clock_next_frame_delay (master_clock);
|
||||
clutter_threads_leave ();
|
||||
|
||||
return delay == 0;
|
||||
}
|
||||
@ -243,6 +247,8 @@ clutter_clock_dispatch (GSource *source,
|
||||
|
||||
CLUTTER_NOTE (SCHEDULER, "Master clock [tick]");
|
||||
|
||||
clutter_threads_enter ();
|
||||
|
||||
/* Get the time to use for this frame.
|
||||
*/
|
||||
g_source_get_current_time (source, &master_clock->cur_tick);
|
||||
@ -274,6 +280,8 @@ clutter_clock_dispatch (GSource *source,
|
||||
|
||||
master_clock->prev_tick = master_clock->cur_tick;
|
||||
|
||||
clutter_threads_leave ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user