diff options
-rw-r--r-- | os/common/oslib/include/chmempools.h | 11 | ||||
-rw-r--r-- | readme.txt | 2 | ||||
-rw-r--r-- | release_note_next.txt | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/os/common/oslib/include/chmempools.h b/os/common/oslib/include/chmempools.h index 5c7666f4e..e2bd4277e 100644 --- a/os/common/oslib/include/chmempools.h +++ b/os/common/oslib/include/chmempools.h @@ -304,8 +304,15 @@ static inline void chGuardedPoolAddI(guarded_memory_pool_t *gmp, void *objp) { * @iclass
*/
static inline void *chGuardedPoolAllocI(guarded_memory_pool_t *gmp) {
-
- return chPoolAllocI(&gmp->pool);
+ void *p;
+
+ p = chPoolAllocI(&gmp->pool);
+ if (p != NULL) {
+ chSemFastWaitI(&gmp->sem);
+ chDbgAssert(chSemGetCounterI(&gmp->sem) >= (cnt_t)0,
+ "semaphore out of sync");
+ }
+ return p;
}
#endif /* CH_CFG_USE_SEMAPHORES == TRUE */
diff --git a/readme.txt b/readme.txt index fa5e5b1fb..fa1a6cf1a 100644 --- a/readme.txt +++ b/readme.txt @@ -166,6 +166,8 @@ dependencies and configuration directories. This makes possible
to have multiple non-conflicting makefiles in the same project.
Updated the various platform.mk implementing "smart build" mode.
+- LIB: Fixed inner semaphore not updated in chGuardedPoolAllocI() function
+ (bug #911).
- HAL: Fixed chprintf float support for 0 precision (bug #910)(backported to
17.6.4 and 16.1.10).
- RT: Fixed compile error with assertions enabled and dynamic extensions
diff --git a/release_note_next.txt b/release_note_next.txt index 6b402943f..2dc4cb2d9 100644 --- a/release_note_next.txt +++ b/release_note_next.txt @@ -45,6 +45,7 @@ received a series of important improvements, new features have been added. exchange complex objects between threads/ISRs. It is based on a
mailbox and a guarded memory pool.
- Added alignment handling to memory pools.
+- Added a new chGuardedPoolAllocI() API to the guarded memory pools.
*** What's new in RT 5.0.0 ***
|