commit | 4db3ba59db87be6a5e21f1b14aa09fff63414229 | [log] [tgz] |
---|---|---|
author | Oliver, Jonathan <git@jonathanoliver.com> | Thu Mar 19 16:42:38 2015 -0600 |
committer | Oliver, Jonathan <git@jonathanoliver.com> | Thu Mar 19 16:42:38 2015 -0600 |
tree | 10d2ea28d4c1b527745ff4755b2f095f21c51a23 | |
parent | 087b7b8020756b170412a84f041e01aaa8058270 [diff] |
Yielding the goroutine.
diff --git a/writer.go b/writer.go index cba826b..cc84971 100644 --- a/writer.go +++ b/writer.go
@@ -1,6 +1,6 @@ package disruptor -import "time" +import "runtime" type Writer struct { written *Cursor @@ -34,7 +34,7 @@ for spin := int64(0); this.previous-this.capacity > this.gate; spin++ { if spin&SpinMask == 0 { - time.Sleep(time.Nanosecond) + runtime.Gosched() // LockSupport.parkNanos(1L); http://bit.ly/1xiDINZ } this.gate = this.upstream.Read(0)