Move queue empty check to the critical section
Move queue empty check to the critical section

Hotspotmar/ouzel,elvman/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elvman/ouzel,Hotspotmar/ouzel,elnormous/ouzel,elnormous/ouzel