Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCountingWriteOnce ¶
func NewCountingWriteOnce(activeCounter counter.GoRoutineCounter, lock sync.Locker, initial interface{}, doneCh <-chan struct{}, doneVal interface{}) promiseifc.WriteOnce
NewCountingWriteOnce creates a WriteOnce that uses locking and counts goroutine activity.
The final three arguments are like those for a regular WriteOnce factory: - an optional initial value, - an optional "done" channel, - the value that is Set after the "done" channel becomes selectable. Note that for this implementation, the reaction to `doneCh` becoming selectable does not wait for a Get. If `doneCh != nil` then the caller promises to close it reasonably promptly (to the degree allowed by the Go runtime scheduler), and increment the goroutine counter before that. The WriteOnce's Get method must be called without the lock held. The WriteOnce's Set method must be called with the lock held.
Types ¶
This section is empty.