MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / Close

Method Close

status_manager.go:141–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139}
140
141func (sm *StatusManager) Close() error {
142 if sm.closed.Load() {
143 return sm.loadCloseErr()
144 }
145
146 if !sm.closing.CompareAndSwap(false, true) {
147 <-sm.closedCh
148 return sm.loadCloseErr()
149 }
150
151 err := sm.close()
152 sm.setCloseErr(err)
153 sm.closed.Store(true)
154 close(sm.closedCh)
155
156 return err
157}
158
159func (sm *StatusManager) close() error {
160 sm.cancel()

Calls 3

loadCloseErrMethod · 0.95
closeMethod · 0.95
setCloseErrMethod · 0.95