author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年03月29日 17:23:35 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年04月01日 22:57:19 +0200 |
commit | 5c80bf0af85627c0e62d0f097e9ed6679f6bed73 (patch) | |
tree | 53c88940049bef966c8994cf59f831c26061a8c2 /agg-plot/canvas-window.cpp | |
parent | e255825367665691584ae44755df5f2882a25c66 (diff) | |
download | gsl-shell-5c80bf0af85627c0e62d0f097e9ed6679f6bed73.tar.gz |
-rw-r--r-- | agg-plot/canvas-window.cpp | 20 |
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 { |