Commit 65fc07b5 authored by David Lam's avatar David Lam Committed by Facebook Github Bot

Fix Synchronized.md documentation to use correct condition_variable::wait call

Summary:
`condition_variable::wait_for` takes as second param `std::chrono::duration`
and not a predicate; what we want is `condition_variable::wait`.

Reviewed By: simpkins

Differential Revision: D4295305

fbshipit-source-id: 05f735fe6e7ecb9d8f42cb38a2985b9ce9dad984
parent 68112fa0
...@@ -669,7 +669,7 @@ The `LockedPtr` returned by `Synchronized<T, std::mutex>::lock()` has a ...@@ -669,7 +669,7 @@ The `LockedPtr` returned by `Synchronized<T, std::mutex>::lock()` has a
// Assuming some other thread will put data on vec and signal // Assuming some other thread will put data on vec and signal
// emptySignal, we can then wait on it as follows: // emptySignal, we can then wait on it as follows:
auto locked = vec.lock(); auto locked = vec.lock();
emptySignal.wait_for(locked.getUniqueLock(), emptySignal.wait(locked.getUniqueLock(),
[&] { return !locked->empty(); }); [&] { return !locked->empty(); });
``` ```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment