blob: 625a5fd55841aab08bd3b04d06e0f5e729ea5881 [file] [log] [blame]
package disruptor
const (
InitialSequenceValue int64 = -1
cpuCacheLinePadding = 7
)
const (
Gating = -2
Idling = -3
Stopped = -4
)
type Cursor struct {
Sequence int64
padding [cpuCacheLinePadding]int64
}
func NewCursor() *Cursor {
return &Cursor{Sequence: InitialSequenceValue}
}
func (this *Cursor) Read(minimum int64) int64 {
return this.Sequence
}
func (this *Cursor) Load() int64 {
return this.Sequence
}
func (this *Cursor) Store(sequence int64) {
this.Sequence = sequence
}