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

Method compareAndSwapState

internal/transport/transport.go:327–329  ·  view source on GitHub ↗
(oldState, newState streamState)

Source from the content-addressed store, hash-verified

325}
326
327func (s *Stream) compareAndSwapState(oldState, newState streamState) bool {
328 return atomic.CompareAndSwapUint32((*uint32)(&s.state), uint32(oldState), uint32(newState))
329}
330
331func (s *Stream) getState() streamState {
332 return streamState(atomic.LoadUint32((*uint32)(&s.state)))

Callers 2

handleDataMethod · 0.80
writeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected