From 2609c72beee098c6afe4bbc3344a1fcee06df94b Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 29 May 2025 21:30:53 +0200 Subject: idleMonitor: switch to the new atomic.Bool api --- mount.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mount.go') diff --git a/mount.go b/mount.go index fe82c0c..1005a39 100644 --- a/mount.go +++ b/mount.go @@ -13,7 +13,6 @@ import ( "runtime" "runtime/debug" "strings" - "sync/atomic" "syscall" "time" @@ -181,7 +180,7 @@ func idleMonitor(idleTimeout time.Duration, fs *fusefrontend.RootNode, srv *fuse } for { // Atomically check whether the flag is 0 and reset it to 1 if so. - isIdle := !atomic.CompareAndSwapUint32(&fs.IsIdle, 0, 1) + isIdle := !fs.IsIdle.CompareAndSwap(false, true) // Any form of current or recent access resets the idle counter. openFileCount := openfiletable.CountOpenFiles() if !isIdle || openFileCount > 0 { -- cgit v1.2.3