chore: merge branch 'master' into v2-exp

This commit is contained in:
Ayman Bagabas
2024-10-21 14:16:22 -04:00
18 changed files with 140 additions and 88 deletions
+3 -9
View File
@@ -2,22 +2,16 @@
package timer
import (
"sync"
"sync/atomic"
"time"
tea "github.com/charmbracelet/bubbletea/v2"
)
var (
lastID int
idMtx sync.Mutex
)
var lastID int64
func nextID() int {
idMtx.Lock()
defer idMtx.Unlock()
lastID++
return lastID
return int(atomic.AddInt64(&lastID, 1))
}
// Authors note with regard to start and stop commands: