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

Function lwp_pid_put

components/lwp/lwp_pid.c:316–336  ·  view source on GitHub ↗

* @brief Release a process ID and clean up associated resources * * @param[in,out] lwp The lightweight process whose PID should be released */

Source from the content-addressed store, hash-verified

314 * @param[in,out] lwp The lightweight process whose PID should be released
315 */
316void lwp_pid_put(struct rt_lwp *lwp)
317{
318 _free_proc_dentry(lwp);
319
320 lwp_pid_lock_take();
321 lwp_pid_put_locked(lwp->pid);
322 if (lwp_pid_root == AVL_EMPTY)
323 {
324 rt_wqueue_wakeup_all(&_pid_emptyq, RT_NULL);
325 /* refuse any new pid allocation now */
326 }
327 else
328 {
329 lwp_pid_lock_release();
330 }
331
332 /* reset pid field */
333 lwp->pid = 0;
334 /* clear reference */
335 lwp_ref_dec(lwp);
336}
337
338/**
339 * @brief Set the LWP for a given PID while holding the PID lock

Callers 3

lwp_createFunction · 0.85
_stats_and_reap_childFunction · 0.85
_resr_cleanupFunction · 0.85

Calls 6

_free_proc_dentryFunction · 0.85
lwp_pid_lock_takeFunction · 0.85
lwp_pid_put_lockedFunction · 0.85
rt_wqueue_wakeup_allFunction · 0.85
lwp_pid_lock_releaseFunction · 0.85
lwp_ref_decFunction · 0.85

Tested by

no test coverage detected