fix(advanced-search): upstream polish — guard DoSearch drain, Yield in worker drain, drop dead ParseValue surface
This commit is contained in:
parent
70ca48cc6b
commit
dcedf91d9e
3 changed files with 14 additions and 8 deletions
|
|
@ -118,8 +118,10 @@ public class AdvancedSearchThreadWorker
|
|||
}
|
||||
else
|
||||
{
|
||||
// Queue is transiently empty but we're not paused yet; avoid a 100%-CPU busy-spin.
|
||||
Thread.SpinWait(1);
|
||||
// Queue is transiently empty but we're not paused yet; yield the core to
|
||||
// other runnable threads (e.g. the other still-filtering workers) instead
|
||||
// of busy-spinning.
|
||||
Thread.Yield();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue