good morning!!!!

Skip to content
Snippets Groups Projects
Commit a7136d0d authored by Garet Halliday's avatar Garet Halliday
Browse files

fix deadlock

parent 8b48275e
No related branches found
No related tags found
No related merge requests found
......@@ -111,13 +111,14 @@ func (T *Sink) _next() *Source {
for {
runtime, source, ok := T.queue.Min()
if !ok {
// unlock to allow work to be added to queue (or stolen) while we wait
T.mu.Unlock()
// attempt to steal
source = T.stealer.steal(T)
if source != nil {
T.mu.Lock()
T._assign(source)
} else {
// unlock to allow work to be added to queue while we wait
T.mu.Unlock()
select {
case <-T.ready:
case <-time.After(stealPeriod):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment