commit | 5c42aaff3955f24c052dde595196fff773222295 | [log] [tgz] |
---|---|---|
author | Ewout van Bekkum <ewout@google.com> | Fri Mar 05 08:59:35 2021 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Sat Mar 06 00:17:06 2021 +0000 |
tree | 894bca53e435c70449cfb93b6eee9da11ab59639 | |
parent | 6acd2aa46d6986d4c9a24273c59d97992b2e6153 [diff] |
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>
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 8a3562a..d666080 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 @@ 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 9a3e95b..0dc116d 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() { - 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 9ae4b7a..4c8fe6c 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 @@ 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());