aboutsummaryrefslogtreecommitdiff
path: root/pw_sync_freertos
diff options
context:
space:
mode:
authorEwout van Bekkum <ewout@google.com>2021-03-05 08:59:35 -0800
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-03-06 00:17:06 +0000
commit5c42aaff3955f24c052dde595196fff773222295 (patch)
tree894bca53e435c70449cfb93b6eee9da11ab59639 /pw_sync_freertos
parent6acd2aa46d6986d4c9a24273c59d97992b2e6153 (diff)
downloadpigweed-5c42aaff3955f24c052dde595196fff773222295.tar.gz
pw_sync_freertos: correct Mutex & Semaphore destructors
Although this is actually a no-op because the same pointer is used, this corrects the destructors to use the handle instead of a pointer to the native type to be locally consistent. Change-Id: Ic790df6532c18d34e1c34c34e4a6fdb7ecb2a36f Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/35882 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Ewout van Bekkum <ewout@google.com>
Diffstat (limited to 'pw_sync_freertos')
-rw-r--r--pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h4
-rw-r--r--pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h2
-rw-r--r--pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h2
3 files changed, 5 insertions, 3 deletions
diff --git a/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h b/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h
index 8a3562a6e..d666080e3 100644
--- a/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h
+++ b/pw_sync_freertos/public/pw_sync_freertos/binary_semaphore_inline.h
@@ -29,7 +29,9 @@ inline BinarySemaphore::BinarySemaphore() : native_type_() {
PW_DASSERT(native_type_.handle != nullptr);
}
-inline BinarySemaphore::~BinarySemaphore() { vSemaphoreDelete(&native_type_); }
+inline BinarySemaphore::~BinarySemaphore() {
+ vSemaphoreDelete(native_type_.handle);
+}
inline void BinarySemaphore::release() {
if (interrupt::InInterruptContext()) {
diff --git a/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h b/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h
index 9a3e95bce..0dc116d45 100644
--- a/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h
+++ b/pw_sync_freertos/public/pw_sync_freertos/counting_semaphore_inline.h
@@ -31,7 +31,7 @@ inline CountingSemaphore::CountingSemaphore() : native_type_() {
}
inline CountingSemaphore::~CountingSemaphore() {
- vSemaphoreDelete(&native_type_);
+ vSemaphoreDelete(native_type_.handle);
}
inline void CountingSemaphore::acquire() {
diff --git a/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h b/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h
index 9ae4b7a14..4c8fe6cbe 100644
--- a/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h
+++ b/pw_sync_freertos/public/pw_sync_freertos/mutex_inline.h
@@ -29,7 +29,7 @@ inline Mutex::Mutex() : native_type_() {
PW_DASSERT(native_type_.handle != nullptr);
}
-inline Mutex::~Mutex() { vSemaphoreDelete(&native_type_); }
+inline Mutex::~Mutex() { vSemaphoreDelete(native_type_.handle); }
inline void Mutex::lock() {
PW_ASSERT(!interrupt::InInterruptContext());