diff options
author | Jakob Unterwurzacher | 2025-05-29 21:30:53 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2025-05-29 21:38:25 +0200 |
commit | 2609c72beee098c6afe4bbc3344a1fcee06df94b (patch) | |
tree | 3cc6f67dd36e57709da150370c3ebb71ce11f3e3 /mount.go | |
parent | 735b194a2c6e6c2c36ecfb37b0e64d16e52577bf (diff) |
idleMonitor: switch to the new atomic.Bool api
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 { |