summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-04-29 02:46:28 -0400
committerGitHub <[email protected]>2022-04-29 14:46:28 +0800
commit1bdde743433d331740766c895ff867df6268df20 (patch)
treef57cbf43fa497b6f727066905999cdad875ad32c /src
parentee1e0a0df08c28645d431cb5610d8dea94f424c4 (diff)
[kernel] update comments for rt_thread_suspend (#5887)
* [kernel] update comments for rt_thread_suspend
Diffstat (limited to 'src')
-rwxr-xr-xsrc/thread.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/thread.c b/src/thread.c
index f0f1422a02..eea42dab8e 100755
--- a/src/thread.c
+++ b/src/thread.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
+ * Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -822,10 +822,11 @@ RTM_EXPORT(rt_thread_control);
* @brief This function will suspend the specified thread and change it to suspend state.
*
* @note This function ONLY can suspend current thread itself.
- * Do not use the rt_thread_suspend and rt_thread_resume functions to synchronize the activities of threads.
- * You have no way of knowing what code a thread is executing when you suspend it.
- * If you suspend a thread while it is executing a critical area which is protected by a mutex,
- * other threads attempt to use that mutex and have to wait. Deadlocks can occur very easily.
+ * rt_thread_suspend(rt_thread_self());
+ *
+ * Do not use the rt_thread_suspend to suspend other threads. You have no way of knowing what code a
+ * thread is executing when you suspend it. If you suspend a thread while sharing a resouce with
+ * other threads and occupying this resouce, starvation can occur very easily.
*
* @param thread is the thread to be suspended.
*
@@ -872,8 +873,6 @@ RTM_EXPORT(rt_thread_suspend);
/**
* @brief This function will resume a thread and put it to system ready queue.
*
- * @note Do not use the rt_thread_suspend and rt_thread_resume functions to synchronize the activities of threads.
- *
* @param thread is the thread to be resumed.
*
* @return Return the operation status. If the return value is RT_EOK, the function is successfully executed.