MCPcopy Create free account
hub / github.com/cloudwego/netpoll / freeable

Method freeable

fd_operator_cache.go:65–72  ·  view source on GitHub ↗

freeable mark the operator that could be freed only poller could do the real free action

(op *FDOperator)

Source from the content-addressed store, hash-verified

63// freeable mark the operator that could be freed
64// only poller could do the real free action
65func (c *operatorCache) freeable(op *FDOperator) {
66 // reset all state
67 op.unused()
68 op.reset()
69 lock(&c.freelocked)
70 c.freelist = append(c.freelist, op.index)
71 unlock(&c.freelocked)
72}
73
74func (c *operatorCache) free() {
75 lock(&c.freelocked)

Callers 4

FreeMethod · 0.80
TestPersistFDOperatorFunction · 0.80

Calls 4

lockFunction · 0.85
unlockFunction · 0.85
unusedMethod · 0.80
resetMethod · 0.45

Tested by 3

TestPersistFDOperatorFunction · 0.64