gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/canvas-window.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年03月29日 17:23:35 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年04月01日 22:57:19 +0200
commit5c80bf0af85627c0e62d0f097e9ed6679f6bed73 (patch)
tree53c88940049bef966c8994cf59f831c26061a8c2 /agg-plot/canvas-window.cpp
parente255825367665691584ae44755df5f2882a25c66 (diff)
downloadgsl-shell-5c80bf0af85627c0e62d0f097e9ed6679f6bed73.tar.gz
Introduce gsl_shell_state and improve factorization
Diffstat (limited to 'agg-plot/canvas-window.cpp')
-rw-r--r--agg-plot/canvas-window.cpp 20
1 files changed, 12 insertions, 8 deletions
diff --git a/agg-plot/canvas-window.cpp b/agg-plot/canvas-window.cpp
index 8d1f1b75..bcec7ac7 100644
--- a/agg-plot/canvas-window.cpp
+++ b/agg-plot/canvas-window.cpp
@@ -105,14 +105,16 @@ canvas_thread_function (void *_inf)
win->unlock();
- pthread_mutex_lock (gsl_shell_shutdown_mutex);
- if (!gsl_shell_shutting_down)
+ gsl_shell_state* gs = win->state();
+
+ pthread_mutex_lock (&gs->shutdown_mutex);
+ if (!gs->is_shutting_down)
{
- GSL_SHELL_LOCK();
- window_index_remove (inf->L, inf->window_id);
- GSL_SHELL_UNLOCK();
+ pthread_mutex_lock(&gs->exec_mutex);
+ window_index_remove (gs->L, inf->window_id);
+ pthread_mutex_unlock(&gs->exec_mutex);
}
- pthread_mutex_unlock (gsl_shell_shutdown_mutex);
+ pthread_mutex_unlock (&gs->shutdown_mutex);
return NULL;
}
@@ -125,9 +127,11 @@ canvas_window::shutdown_close()
{
close_request();
unlock();
- pthread_mutex_unlock (gsl_shell_shutdown_mutex);
+
+ gsl_shell_state* gs = this->m_gsl_shell;
+ pthread_mutex_unlock (&gs->shutdown_mutex);
pthread_join(m_thread, NULL);
- pthread_mutex_lock (gsl_shell_shutdown_mutex);
+ pthread_mutex_lock (&gs->shutdown_mutex);
}
else
{
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月14日 01:19:27 +0000

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