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

Function lwp_pid_put_locked

components/lwp/lwp_pid.c:274–291  ·  view source on GitHub ↗

* @brief Release a PID back to the free list while holding the PID lock * * @param[in] pid The process ID to release (must not be 0) * * @note This function removes the specified PID from the active PID tree and * adds it to the free list. The operation is performed atomically while * holding the PID management lock. */

Source from the content-addressed store, hash-verified

272 * holding the PID management lock.
273 */
274static void lwp_pid_put_locked(pid_t pid)
275{
276 struct lwp_avl_struct *p;
277
278 if (pid == 0)
279 {
280 return;
281 }
282
283 p = lwp_avl_find(pid, lwp_pid_root);
284 if (p)
285 {
286 p->data = RT_NULL;
287 lwp_avl_remove(p, &lwp_pid_root);
288 p->avl_right = lwp_pid_free_head;
289 lwp_pid_free_head = p;
290 }
291}
292
293#ifdef RT_USING_DFS_PROCFS
294 /**

Callers 1

lwp_pid_putFunction · 0.85

Calls 2

lwp_avl_findFunction · 0.85
lwp_avl_removeFunction · 0.85

Tested by

no test coverage detected