aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chdynamic.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/src/chdynamic.c')
-rw-r--r--os/rt/src/chdynamic.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/os/rt/src/chdynamic.c b/os/rt/src/chdynamic.c
index 60b0cbe19..28cebe9c8 100644
--- a/os/rt/src/chdynamic.c
+++ b/os/rt/src/chdynamic.c
@@ -54,78 +54,6 @@
/* Module exported functions. */
/*===========================================================================*/
-/**
- * @brief Adds a reference to a thread object.
- * @pre The configuration option @p CH_CFG_USE_DYNAMIC must be enabled in
- * order to use this function.
- *
- * @param[in] tp pointer to the thread
- * @return The same thread pointer passed as parameter
- * representing the new reference.
- *
- * @api
- */
-thread_t *chThdAddRef(thread_t *tp) {
-
- chSysLock();
- chDbgAssert(tp->refs < (trefs_t)255, "too many references");
- tp->refs++;
- chSysUnlock();
-
- return tp;
-}
-
-/**
- * @brief Releases a reference to a thread object.
- * @details If the references counter reaches zero <b>and</b> the thread
- * is in the @p CH_STATE_FINAL state then the thread's memory is
- * returned to the proper allocator.
- * @pre The configuration option @p CH_CFG_USE_DYNAMIC must be enabled in
- * order to use this function.
- * @note Static threads are not affected.
- *
- * @param[in] tp pointer to the thread
- *
- * @api
- */
-void chThdRelease(thread_t *tp) {
- trefs_t refs;
-
- chSysLock();
- chDbgAssert(tp->refs > (trefs_t)0, "not referenced");
- tp->refs--;
- refs = tp->refs;
- chSysUnlock();
-
- /* If the references counter reaches zero and the thread is in its
- terminated state then the memory can be returned to the proper
- allocator. Of course static threads are not affected.*/
- if ((refs == (trefs_t)0) && (tp->state == CH_STATE_FINAL)) {
- switch (tp->flags & CH_FLAG_MODE_MASK) {
-#if CH_CFG_USE_HEAP == TRUE
- case CH_FLAG_MODE_HEAP:
-#if CH_CFG_USE_REGISTRY == TRUE
- REG_REMOVE(tp);
-#endif
- chHeapFree(chthdGetStackLimitX(tp));
- break;
-#endif
-#if CH_CFG_USE_MEMPOOLS == TRUE
- case CH_FLAG_MODE_MPOOL:
-#if CH_CFG_USE_REGISTRY == TRUE
- REG_REMOVE(tp);
-#endif
- chPoolFree(tp->mpool, chthdGetStackLimitX(tp));
- break;
-#endif
- default:
- /* Nothing to do for static threads, those are removed from the
- registry on exit.*/
- break;
- }
- }
-}
-
#if (CH_CFG_USE_HEAP == TRUE) || defined(__DOXYGEN__)
/**
* @brief Creates a new thread allocating the memory from the heap.