race

package
v3.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncedReadCloser

type SyncedReadCloser struct {
	// contains filtered or unexported fields
}

SyncedReadCloser is compatible with io.ReadSeeker and performs gate-based synced writes to enable race condition testing.

func NewOpenGateWithTimeout

func NewOpenGateWithTimeout(r io.ReadCloser, d time.Duration) *SyncedReadCloser

NewOpenGateWithTimeout creates a new open gate with a timeout

func NewSyncedReadCloser

func NewSyncedReadCloser(r io.ReadCloser) *SyncedReadCloser

NewSyncedReadCloser creates a new SyncedReadCloser instance.

func (*SyncedReadCloser) Close

func (s *SyncedReadCloser) Close() error

Close closes an io.ReadSeeker

func (*SyncedReadCloser) Len

func (s *SyncedReadCloser) Len() int

Len returns the length of data in reader

func (*SyncedReadCloser) OpenGate

func (s *SyncedReadCloser) OpenGate()

OpenGate opens the gate allowing all requests to be completed

func (*SyncedReadCloser) OpenGateAfter

func (s *SyncedReadCloser) OpenGateAfter(d time.Duration)

OpenGateAfter schedules gate to be opened after a duration

func (*SyncedReadCloser) Read

func (s *SyncedReadCloser) Read(p []byte) (n int, err error)

Read implements read method for io.ReadSeeker

func (*SyncedReadCloser) Seek

func (s *SyncedReadCloser) Seek(offset int64, whence int) (int64, error)

Seek implements seek method for io.ReadSeeker

func (*SyncedReadCloser) SetOpenGate

func (s *SyncedReadCloser) SetOpenGate(status bool)

SetOpenGate sets the status of the blocking gate

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL