fixed problem with window locks and AGG locks order - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2010年08月26日 00:17:54 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2010年08月26日 00:17:54 +0200
commitf462145565a4a97f749c08239767e98f4b1ba9ab (patch)
tree3dddc4b7a9979729b36c375b8a42bd0759e1ce95 /agg-plot/window.cpp
parentd323e179f46d19488afa5001c1725d7e3268a806 (diff)
downloadgsl-shell-f462145565a4a97f749c08239767e98f4b1ba9ab.tar.gz
fixed problem with window locks and AGG locks order
Now we never perform a window lock from inside an AGG lock.
Diffstat (limited to 'agg-plot/window.cpp')
-rw-r--r--agg-plot/window.cpp 32
1 files changed, 8 insertions, 24 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index 7c4f7edc..c45d3bc8 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -129,7 +129,9 @@ void window::draw_slot_by_ref(window::ref& ref, bool dirty)
{
agg::rect_base<int> r = rect_of_slot_matrix(mtx);
m_canvas->clear_box(r);
+ AGG_LOCK();
ref.plot->draw(*m_canvas, mtx);
+ AGG_UNLOCK();
platform_support_update_region (this, r);
}
else
@@ -149,7 +151,7 @@ window::draw_slot(int slot_id, bool update_req)
}
void
-window::on_draw_unprotected()
+window::on_draw()
{
if (! m_canvas)
return;
@@ -158,14 +160,6 @@ window::on_draw_unprotected()
draw_rec(m_tree);
}
-void
-window::on_draw()
-{
- AGG_LOCK();
- on_draw_unprotected();
- AGG_UNLOCK();
-}
-
window *
window::check (lua_State *L, int index)
{
@@ -316,26 +310,16 @@ window_attach (lua_State *L)
}
int
-window_slot_update_unprotected (lua_State *L)
+window_slot_update (lua_State *L)
{
window *win = window::check (L, 1);
int slot_id = luaL_checkinteger (L, 2);
win->lock();
- win->draw_slot(slot_id, true);
- win->unlock();
-
- return 0;
-}
-
-int
-window_update_unprotected (lua_State *L)
-{
- window *win = window::check (L, 1);
-
- win->lock();
- win->on_draw_unprotected();
- win->update_window();
+ if (win->status == canvas_window::running)
+ {
+ win->draw_slot(slot_id, true);
+ }
win->unlock();
return 0;
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月12日 17:40:14 +0000

AltStyle によって変換されたページ (->オリジナル) /