Download third_party/CityFlow/src/utility/barrier.cpp from Aditya2162/agentic-traffic: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/Aditya2162/agentic-traffic/resolve/main/third_party/CityFlow/src/utility/barrier.cpp
- Command line
-
hf download hf://Aditya2162/agentic-traffic/third_party/CityFlow/src/utility/barrier.cpp
-
curl -L -o barrier.cpp https://huggingface.co/Aditya2162/agentic-traffic/resolve/main/third_party/CityFlow/src/utility/barrier.cpp
505 Bytes
| namespace CityFlow { | |
| void Barrier::wait() { | |
| std::unique_lock<std::mutex> lock(m_mutex); | |
| assert(0u != *currCounter); | |
| if (!--*currCounter) { | |
| currCounter += currCounter == counter ? 1 : -1; | |
| *currCounter = m_threads; | |
| m_condition.notify_all(); | |
| } else { | |
| size_t *currCounter_local = currCounter; | |
| m_condition.wait(lock, [currCounter_local] { return *currCounter_local == 0; }); | |
| } | |
| } | |
| } |