MCPcopy
hub / github.com/grpc/grpc-go / swapState

Method swapState

internal/transport/transport.go:323–325  ·  view source on GitHub ↗
(st streamState)

Source from the content-addressed store, hash-verified

321}
322
323func (s *Stream) swapState(st streamState) streamState {
324 return streamState(atomic.SwapUint32((*uint32)(&s.state), uint32(st)))
325}
326
327func (s *Stream) compareAndSwapState(oldState, newState streamState) bool {
328 return atomic.CompareAndSwapUint32((*uint32)(&s.state), uint32(oldState), uint32(newState))

Callers 4

finishStreamMethod · 0.80
closeStreamMethod · 0.80
NewStreamMethod · 0.80
closeStreamMethod · 0.80

Calls 1

streamStateTypeAlias · 0.85

Tested by

no test coverage detected