aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2018-05-19 10:34:19 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-05-19 10:34:19 +0200
commit2d19605ba8f2a630d762e08578206c4935723da4 (patch)
tree5c5ce14ad2dd9df9d57280cfabe78b5856ee2f63
parent1418e40793931bb7c3212aaadc26c4fa4552a396 (diff)
downloadcalcurse-2d19605ba8f2a630d762e08578206c4935723da4.tar.gz
calcurse-2d19605ba8f2a630d762e08578206c4935723da4.zip
Unlock the save mutex as early as possible
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/io.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/io.c b/src/io.c
index 9c20465..cc2cb28 100644
--- a/src/io.c
+++ b/src/io.c
@@ -592,6 +592,11 @@ void io_save_cal(enum save_display display)
io_unset_modified();
+ io_compute_hash(path_apts, apts_sha1);
+ io_compute_hash(path_todo, todo_sha1);
+
+ io_mutex_unlock();
+
/* Print a message telling data were saved */
if (ui_mode == UI_CURSES && display == IO_SAVE_DISPLAY_BAR &&
show_dialogs()) {
@@ -599,10 +604,6 @@ void io_save_cal(enum save_display display)
keys_wait_for_any_key(win[KEY].p);
}
- io_compute_hash(path_apts, apts_sha1);
- io_compute_hash(path_todo, todo_sha1);
-
- io_mutex_unlock();
run_hook("post-save");
}