* @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. */
| 1911 | * by checking the exit_request atomic flag. |
| 1912 | */ |
| 1913 | int 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 | |
| 1927 | static void _wait_sibling_exit(rt_lwp_t lwp, rt_thread_t curr_thread); |
| 1928 | static void _resr_cleanup(struct rt_lwp *lwp); |
nothing calls this directly
no test coverage detected