aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-06-11 10:13:48 +0000
committernyamatongwe <devnull@localhost>2010-06-11 10:13:48 +0000
commit1174d9265b591002dfe97357b3a6797b79cbe4d6 (patch)
tree5c79eaaee86313ca69ff14a53bf60e7a66b5592e
parente4e13cecf95538bd81505cd9d037c91f232c19ac (diff)
downloadscintilla-mirror-1174d9265b591002dfe97357b3a6797b79cbe4d6.tar.gz
Ensure thread safety with idle callbacks in case application is multithreaded.
See http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html#id2755107
-rw-r--r--gtk/ScintillaGTK.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index a94cfcb13..dfe0c2f8b 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -2317,6 +2317,7 @@ int ScintillaGTK::TimeOut(ScintillaGTK *sciThis) {
gboolean ScintillaGTK::IdleCallback(ScintillaGTK *sciThis) {
// Idler will be automatically stopped, if there is nothing
// to do while idle.
+ gdk_threads_enter();
bool ret = sciThis->Idle();
if (ret == false) {
// FIXME: This will remove the idler from GTK, we don't want to
@@ -2324,11 +2325,14 @@ gboolean ScintillaGTK::IdleCallback(ScintillaGTK *sciThis) {
// returns false (although, it should be harmless).
sciThis->SetIdle(false);
}
+ gdk_threads_leave();
return ret;
}
gboolean ScintillaGTK::StyleIdle(ScintillaGTK *sciThis) {
+ gdk_threads_enter();
sciThis->IdleStyling();
+ gdk_threads_leave();
// Idler will be automatically stopped
return FALSE;
}