diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2017-02-06 01:10:21 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2017-02-06 01:10:21 +0200 |
commit | 07559fc63b34b51e5602a8b07ae577f878a6a29f (patch) | |
tree | db5ef8f7acc707f3cfebb1c4ec5767bd0eb0a7c3 /stackless | |
parent | stackless: added NewFunc() for wrapping stack-hungry CPU-bound functions (diff) | |
download | fasthttp-07559fc63b34b51e5602a8b07ae577f878a6a29f.tar.gz fasthttp-07559fc63b34b51e5602a8b07ae577f878a6a29f.tar.bz2 fasthttp-07559fc63b34b51e5602a8b07ae577f878a6a29f.zip |
stackless: send "func done" notification over a buffered channel, so the funcWorker could process multiple work items without switching to other goroutines
Diffstat (limited to 'stackless')
-rw-r--r-- | stackless/func.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stackless/func.go b/stackless/func.go index b00a4de..4202b49 100644 --- a/stackless/func.go +++ b/stackless/func.go @@ -59,7 +59,7 @@ func getFuncWork() *funcWork { v := funcWorkPool.Get() if v == nil { v = &funcWork{ - done: make(chan struct{}), + done: make(chan struct{}, 1), } } return v.(*funcWork) |