support wait queue.Fixes #495