From 3c3636637e1c517d769b948baff54433b100c9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Sun, 11 Feb 2024 22:51:33 +0100 Subject: [PATCH] Fix possible lock --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 21c7fed..4552f75 100644 --- a/main.go +++ b/main.go @@ -40,8 +40,10 @@ type RealSleeper struct { } func (self RealSleeper) Sleep(ch chan<- interface{}) { - time.Sleep(self.duration) - ch <- nil + go func() { + time.Sleep(self.duration) + ch <- nil + }() } func getCmdLineParams(logger *log.Logger) (string, []int64) {