- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for IsClosed (0.32 sec)
-
internal/lock/lock.go
// has reached zero, i.e when all the readers have given up their locks. type RLockedFile struct { *LockedFile mutex sync.Mutex refs int // Holds read lock refs. } // IsClosed - Check if the rlocked file is already closed. func (r *RLockedFile) IsClosed() bool { r.mutex.Lock() defer r.mutex.Unlock() return r.refs == 0 } // IncLockRef - is used by called to indicate lock refs. func (r *RLockedFile) IncLockRef() {
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Sun Jan 02 17:15:06 GMT 2022 - 2.5K bytes - Viewed (0) -
internal/lock/lock_test.go
t.Fatal(err) } }() rlk, err := RLockedOpenFile(f.Name()) if err != nil { t.Fatal(err) } isClosed := rlk.IsClosed() if isClosed { t.Fatal("File ref count shouldn't be zero") } // Increase reference count to 2. rlk.IncLockRef() isClosed = rlk.IsClosed() if isClosed { t.Fatal("File ref count shouldn't be zero") } // Decrease reference count by 1.
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Mon Sep 19 18:05:16 GMT 2022 - 3.6K bytes - Viewed (0) -
internal/grid/connection.go
case debugSetClientPingDuration: c.clientPingInterval = args[0].(time.Duration) case debugAddToDeadline: c.addDeadline = args[0].(time.Duration) case debugIsOutgoingClosed: // params: muxID uint64, isClosed func(bool) muxID := args[0].(uint64) resp := args[1].(func(b bool)) mid, ok := c.outgoing.Load(muxID) if !ok || mid == nil { resp(true) return } mid.respMu.Lock()
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Thu Apr 04 12:04:40 GMT 2024 - 42.6K bytes - Viewed (0)