MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / lwp_from_pid_raw_locked

Function lwp_from_pid_raw_locked

components/lwp/lwp_pid.c:1024–1036  ·  view source on GitHub ↗

* @brief Retrieves a lightweight process (LWP) by its PID while holding the lock * * @param[in] pid The process ID to look up * * @return struct rt_lwp* Pointer to the LWP structure if found, RT_NULL otherwise * * @note This function performs a raw lookup in the PID AVL tree while assuming * the caller already holds the necessary locks. It's a lower-level version * of lwp_from_

Source from the content-addressed store, hash-verified

1022 * of lwp_from_pid() that doesn't handle locking internally.
1023 */
1024struct rt_lwp* lwp_from_pid_raw_locked(pid_t pid)
1025{
1026 struct lwp_avl_struct *p;
1027 struct rt_lwp *lwp = RT_NULL;
1028
1029 p = lwp_avl_find(pid, lwp_pid_root);
1030 if (p)
1031 {
1032 lwp = (struct rt_lwp *)p->data;
1033 }
1034
1035 return lwp;
1036}
1037
1038/**
1039 * @brief Retrieves a lightweight process (LWP) by PID with lock handling

Callers 4

lwp_from_pid_lockedFunction · 0.85
cmd_killFunction · 0.85
cmd_killallFunction · 0.85
sys_killFunction · 0.85

Calls 1

lwp_avl_findFunction · 0.85

Tested by

no test coverage detected