Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The enqueue function returns the number of items in the work queue #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

umar456
Copy link
Member

@umar456 umar456 commented Apr 13, 2018

No description provided.

@umar456 umar456 requested a review from pavanky April 13, 2018 02:43
cond.notify_one();
}
return;
return count;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a bit misleading ? If you enqueue from the queue you are going to get 0. Why not always return work_queue.size() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to take the lock to get the count. It also make sense because the operations are performed immediately and they are not inserted into the queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants