Commit fce8d4e1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0546b65f
...@@ -551,6 +551,16 @@ func (t *T) RxEvent(event interface{}) { ...@@ -551,6 +551,16 @@ func (t *T) RxEvent(event interface{}) {
} }
t.tracev = append(t.tracev, eventTrace{t0, stream, event}) t.tracev = append(t.tracev, eventTrace{t0, stream, event})
ch := t.chanForStream(stream) ch := t.chanForStream(stream)
var delay time.Duration
d, ok := t.delayInjectTab[stream]
if ok {
if d.seqno == d.delayAt {
delay = d.delayT
}
d.seqno++
}
t.mu.Unlock() t.mu.Unlock()
if ch == nil { if ch == nil {
...@@ -583,9 +593,10 @@ func (t *T) RxEvent(event interface{}) { ...@@ -583,9 +593,10 @@ func (t *T) RxEvent(event interface{}) {
// http://www.1024cores.net/home/relacy-race-detector // http://www.1024cores.net/home/relacy-race-detector
// http://www.1024cores.net/home/relacy-race-detector/rrd-introduction // http://www.1024cores.net/home/relacy-race-detector/rrd-introduction
if delay != 0 {
time.Sleep(delay)
}
// TODO timeout: deadlock? (print all-in-flight events on timeout)
// XXX or better ^^^ to do on receiver side? -> yes - on receiver
ch.Send(event) ch.Send(event)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment