Revert "Make main work block async"

There is currently a bug where this causes a copy storm at startup. More
worryingly, more and more newlines are appended to the end, so something
is going wrong in copy logic anyway, async or not.

This reverts commit 11304d3a60.
This commit is contained in:
Chris Down 2018-02-20 09:29:49 +00:00
parent caab3f6a62
commit a85f8998b4

View file

@ -11,7 +11,7 @@ major_version=4
cache_dir=$CM_DIR/clipmenu.$major_version.$USER/ cache_dir=$CM_DIR/clipmenu.$major_version.$USER/
cache_file=$cache_dir/line_cache cache_file=$cache_dir/line_cache
lock_file=$cache_dir/lock lock_file=$cache_dir/lock
lock_timeout=5 lock_timeout=2
has_clipnotify=0 has_clipnotify=0
# This comes from the environment, so we rely on word splitting. # This comes from the environment, so we rely on word splitting.
@ -141,7 +141,6 @@ while true; do
fi fi
fi fi
{
if ! flock -x -w "$lock_timeout" "$lock_fd"; then if ! flock -x -w "$lock_timeout" "$lock_fd"; then
printf 'ERROR: %s\n' 'Timed out waiting for lock' >&2 printf 'ERROR: %s\n' 'Timed out waiting for lock' >&2
exit 1 exit 1
@ -192,10 +191,8 @@ while true; do
done done
flock -u "$lock_fd" flock -u "$lock_fd"
} &
if (( CM_ONESHOT )); then if (( CM_ONESHOT )); then
wait
debug 'Oneshot mode enabled, exiting' debug 'Oneshot mode enabled, exiting'
break break
fi fi