* @brief Retrieves a lightweight process (LWP) by PID with lock handling * * @param[in] pid The process ID to look up (0 means current process) * * @return struct rt_lwp* Pointer to the LWP structure if found, current LWP if pid=0 * * @note This is a convenience wrapper that: * - If pid is non-zero, calls lwp_from_pid_raw_locked() * - If pid is zero, returns the current LWP via
| 1047 | * - If pid is zero, returns the current LWP via lwp_self() |
| 1048 | */ |
| 1049 | struct rt_lwp* lwp_from_pid_locked(pid_t pid) |
| 1050 | { |
| 1051 | struct rt_lwp* lwp; |
| 1052 | lwp = pid ? lwp_from_pid_raw_locked(pid) : lwp_self(); |
| 1053 | return lwp; |
| 1054 | } |
| 1055 | |
| 1056 | /** |
| 1057 | * @brief Converts a lightweight process (LWP) to its PID |
no test coverage detected