MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / lwp_check_exit_request

Function lwp_check_exit_request

components/lwp/lwp_pid.c:1913–1925  ·  view source on GitHub ↗

* @brief Checks if the current thread has received an exit request * * @return int Returns: * - 0 if no exit request or not an LWP thread * - 1 if exit request was triggered and set to IN_PROCESS * * @note Verifies if the current lightweight process thread has been requested to exit * by checking the exit_request atomic flag. */

Source from the content-addressed store, hash-verified

1911 * by checking the exit_request atomic flag.
1912 */
1913int lwp_check_exit_request(void)
1914{
1915 rt_thread_t thread = rt_thread_self();
1916 rt_size_t expected = LWP_EXIT_REQUEST_TRIGGERED;
1917
1918 if (!thread->lwp)
1919 {
1920 return 0;
1921 }
1922
1923 return atomic_compare_exchange_strong(&thread->exit_request, &expected,
1924 LWP_EXIT_REQUEST_IN_PROCESS);
1925}
1926
1927static void _wait_sibling_exit(rt_lwp_t lwp, rt_thread_t curr_thread);
1928static void _resr_cleanup(struct rt_lwp *lwp);

Callers

nothing calls this directly

Calls 1

rt_thread_selfFunction · 0.85

Tested by

no test coverage detected