Skip to content

Commit 9caaf6f

Browse files
committed
FIX on SleepQueue
1 parent 4e6d999 commit 9caaf6f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

thread/thread.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ namespace photon
391391
// compare m_nodes[idx] with parent node.
392392
bool up(int idx)
393393
{
394+
if (q.empty()) return false;
394395
auto tmp = q[idx];
395396
bool ret = false;
396397
while (idx != 0){
@@ -410,6 +411,7 @@ namespace photon
410411
// compare m_nodes[idx] with child node.
411412
bool down(int idx)
412413
{
414+
if (q.empty()) return false;
413415
auto tmp = q[idx];
414416
size_t cmpIdx = (idx << 1) + 1;
415417
bool ret = false;

0 commit comments

Comments
 (0)