aboutsummaryrefslogtreecommitdiffstats
path: root/os/oslib/include/chmempools.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/oslib/include/chmempools.h')
-rw-r--r--os/oslib/include/chmempools.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/os/oslib/include/chmempools.h b/os/oslib/include/chmempools.h
index 6e5a45277..427ba9fb1 100644
--- a/os/oslib/include/chmempools.h
+++ b/os/oslib/include/chmempools.h
@@ -249,6 +249,19 @@ static inline void chGuardedPoolObjectInit(guarded_memory_pool_t *gmp,
}
/**
+ * @brief Gets the count of objects in a guarded memory pool.
+ * @pre The guarded memory pool must be already been initialized.
+ *
+ * @param[in] gmp pointer to a @p guarded_memory_pool_t structure
+ *
+ * @iclass
+ */
+static inline cnt_t chGuardedPoolGetCounterI(guarded_memory_pool_t *gmp) {
+
+ return chSemGetCounterI(&gmp->sem);
+}
+
+/**
* @brief Allocates an object from a guarded memory pool.
* @pre The guarded memory pool must be already been initialized.
*