mirror of
https://github.com/tmux-plugins/tmux-continuum.git
synced 2024-11-24 04:08:47 +00:00
Handle missing flock
If flock is not installed, fall back to the thread-unsafe version.
This commit is contained in:
parent
721890d22f
commit
10e612d72c
@ -36,7 +36,9 @@ fetch_and_run_tmux_resurrect_save_script() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
(
|
(
|
||||||
flock -n 101 || return # The code below is not thread-safe.
|
# The code after "flock" is not thread-safe. A race condition can be triggered by multiple
|
||||||
|
# tmux clients performing autosave in parallel.
|
||||||
|
! command -v flock || flock -n 101 || return
|
||||||
if supported_tmux_version_ok && auto_save_not_disabled && enough_time_since_last_run_passed; then
|
if supported_tmux_version_ok && auto_save_not_disabled && enough_time_since_last_run_passed; then
|
||||||
fetch_and_run_tmux_resurrect_save_script
|
fetch_and_run_tmux_resurrect_save_script
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user