Skip to content

Commit

Permalink
Merge pull request #5 from pharosnet/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
RyougiNevermore authored Apr 28, 2018
2 parents da2bdfd + 5de6cda commit e5b8b05
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A flyline buffer works similar to a standard Go channel with the following featu

### Installing

To start using fastlane, install Go and run `go get`:
To start using flyline, install Go and run `go get`:

```sh
$ go get github.com/pharosnet/flyline
Expand Down
3 changes: 2 additions & 1 deletion array.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

type entry struct {
value interface{}
value interface{}
padding [7]int64
}

func newArray(capacity int64) (a *array) {
Expand Down
4 changes: 2 additions & 2 deletions array_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (b *arrayBuffer) Send(i interface{}) (err error) {
b.wdSeq.Incr()
break
}
time.Sleep(500 * time.Microsecond)
time.Sleep(1 * time.Nanosecond)
if times <= 0 {
runtime.Gosched()
times = 10
Expand All @@ -74,7 +74,7 @@ func (b *arrayBuffer) Recv() (value interface{}, active bool) {
b.rdSeq.Incr()
break
}
time.Sleep(500 * time.Microsecond)
time.Sleep(1 * time.Nanosecond)
if times <= 0 {
runtime.Gosched()
times = 10
Expand Down
5 changes: 4 additions & 1 deletion sequence.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package flyline

import (
"runtime"
"sync/atomic"
"runtime"
"time"
)

// Sequence New Function, value starts from -1.
Expand All @@ -29,6 +30,7 @@ func (s *Sequence) Incr() (value int64) {
value = nextValue
break
}
time.Sleep(1 * time.Nanosecond)
if times <= 0 {
times = 10
runtime.Gosched()
Expand All @@ -48,6 +50,7 @@ func (s *Sequence) Decr() (value int64) {
value = preValue
break
}
time.Sleep(1 * time.Nanosecond)
if times <= 0 {
times = 10
runtime.Gosched()
Expand Down

0 comments on commit e5b8b05

Please sign in to comment.