mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add format script which invokes clang-format on the C++ source code (#41)
On Windows machines, clang-format.exe must be in the PATH environment variable.
This commit is contained in:
committed by
Peter Johnson
parent
68690643d2
commit
e14e45da76
@@ -7,9 +7,7 @@
|
||||
|
||||
#include "HAL/cpp/Semaphore.hpp"
|
||||
|
||||
Semaphore::Semaphore(uint32_t count) {
|
||||
m_count = count;
|
||||
}
|
||||
Semaphore::Semaphore(uint32_t count) { m_count = count; }
|
||||
|
||||
void Semaphore::give() {
|
||||
std::lock_guard<priority_mutex> lock(m_mutex);
|
||||
@@ -19,7 +17,7 @@ void Semaphore::give() {
|
||||
|
||||
void Semaphore::take() {
|
||||
std::unique_lock<priority_mutex> lock(m_mutex);
|
||||
m_condition.wait(lock, [this] { return m_count; } );
|
||||
m_condition.wait(lock, [this] { return m_count; });
|
||||
--m_count;
|
||||
}
|
||||
|
||||
@@ -28,8 +26,7 @@ bool Semaphore::tryTake() {
|
||||
if (m_count) {
|
||||
--m_count;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user