diff options
authorLars Henriksen <LarsHenriksen@get2net.dk>2020-07-14 08:45:39 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2020-07-26 10:31:33 -0400
commit7b8b7f0548c2f71a1a068419f5712e2d7026485f (patch)
parent2230525f4a14ae9e8a5e7a76ae205101904a7f7f (diff)
Revert "Interrupt periodic save when launching process"
This reverts commit 0f3d198 (Interrupt periodic save when launching process, 2017-09-08). Stopping and starting periodic save when external/hook programs are run causes deadlocks. The periodic save thread cannot be stopped/started at will, but should be started once and run uninterrupted as long as calcurse runs. Only if the configuration parameter is changed, must the thread be stopped and possibly restarted. The reasons are - the start routine unconditionally starts a thread. - the mechanism used to detect whether a thread is running or not, is designed to be used by the main calcurse thread only and with only one running thread of each kind (the thread ID of each running thread is kept in a variable; if the thread is not running, the variable has the main thread ID as value). Any load hook will be run at the initial dataload, and the stop/start calls will start a perodic save thread (this is true for the notify thread as well). Later when threads are started, a second periodic save thread is started (for the notify thread, a running thread is stopped before restart). When hooks are run by the periodic save thread, the stop call breaks down, leading to two running save threads (if not the case already) and subsequently to a deadlock when one thread tries to stop the other. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
1 files changed, 0 insertions, 4 deletions
diff --git a/src/wins.c b/src/wins.c
index 485c59b..5f4c0ba 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -593,8 +593,6 @@ void wins_prepare_external(void)
if (notify_bar())
- if (conf.periodic_save > 0)
- io_stop_psave_thread();
ui_mode = UI_CMDLINE;
@@ -615,8 +613,6 @@ void wins_unprepare_external(void)
if (notify_bar())
- if (conf.periodic_save > 0)
- io_start_psave_thread();