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

Function lwp_pid_set_lwp_locked

components/lwp/lwp_pid.c:348–365  ·  view source on GitHub ↗

* @brief Set the LWP for a given PID while holding the PID lock * * @param[in] pid The process ID to set the LWP for * @param[in] lwp The LWP to associate with the PID * * @note This function associates the specified LWP with the given PID in the * PID AVL tree. It increments the LWP's reference count and updates the * proc filesystem entry if the PID is non-zero. */

Source from the content-addressed store, hash-verified

346 * proc filesystem entry if the PID is non-zero.
347 */
348static void lwp_pid_set_lwp_locked(pid_t pid, struct rt_lwp *lwp)
349{
350 struct lwp_avl_struct *p;
351
352 p = lwp_avl_find(pid, lwp_pid_root);
353 if (p)
354 {
355 p->data = lwp;
356 lwp_ref_inc(lwp);
357
358#ifdef RT_USING_DFS_PROCFS
359 if (pid)
360 {
361 proc_pid(pid);
362 }
363#endif
364 }
365}
366
367/**
368 * @brief Close all open files for the given LWP

Callers 1

lwp_createFunction · 0.85

Calls 3

lwp_avl_findFunction · 0.85
lwp_ref_incFunction · 0.85
proc_pidFunction · 0.85

Tested by

no test coverage detected