aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-01-16 15:19:45 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-01-16 15:19:45 +0000
commitbae22c6d4ba9d0a23ad16159b105964ca8813f0d (patch)
tree5e983ad92d6860f10a3d7af39aaad2587fb0ff01
parentb685bbe51dde88c5a2654b378b156ae01e8da316 (diff)
downloadChibiOS-bae22c6d4ba9d0a23ad16159b105964ca8813f0d.tar.gz
ChibiOS-bae22c6d4ba9d0a23ad16159b105964ca8813f0d.tar.bz2
ChibiOS-bae22c6d4ba9d0a23ad16159b105964ca8813f0d.zip
Fixed bug #911.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11295 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/common/oslib/include/chmempools.h11
-rw-r--r--readme.txt2
-rw-r--r--release_note_next.txt1
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 ***