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

Refactor local::condition_variable #2072

Merged
merged 6 commits into from Apr 6, 2016
Merged

Refactor local::condition_variable #2072

merged 6 commits into from Apr 6, 2016

Conversation

K-ballo
Copy link
Member

@K-ballo K-ballo commented Apr 5, 2016

  • Split condition_variable and condition_variable_any
  • Restrict detail::condition_variable to spinlocks only, avoid unnecessary relocking
  • Adjust uses of cv as needed

// splice is constant time only if it == end
queue.splice(queue.end(), queue_);
queue_.swap(queue);
relock_guard rl(lock);
Copy link
Member

Choose a reason for hiding this comment

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

Since the lock is moved into wait down below, is it really save to relock it again afterwards?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the lock is not actually moved from, only casted to an rvalue.

@K-ballo
Copy link
Member Author

K-ballo commented Apr 5, 2016

The changes to shared_mutex and counting_semaphore need extra special attention.

@hkaiser hkaiser added this to the 0.9.12 milestone Apr 5, 2016
@hkaiser
Copy link
Member

hkaiser commented Apr 5, 2016

LGTM! Thanks!

@sithhell sithhell merged commit e1328ca into master Apr 6, 2016
@sithhell sithhell deleted the local-cv branch April 6, 2016 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants