MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / lwp_pid_for_each

Function lwp_pid_for_each

components/lwp/lwp_pid.c:177–191  ·  view source on GitHub ↗

* @brief Iterate over all process IDs * * @param[in] cb Callback function to execute for each PID * @param[in] data User-provided context data * * @return int Error code (0 on success, negative on error) */

Source from the content-addressed store, hash-verified

175 * @return int Error code (0 on success, negative on error)
176 */
177int lwp_pid_for_each(int (*cb)(pid_t pid, void *data), void *data)
178{
179 int error;
180 struct pid_foreach_param buf =
181 {
182 .cb = cb,
183 .data = data,
184 };
185
186 lwp_pid_lock_take();
187 error = lwp_avl_traversal(lwp_pid_root, _before_cb, &buf);
188 lwp_pid_lock_release();
189
190 return error;
191}
192
193/**
194 * @brief Get the PID array

Callers 1

lwp_signal_kill_allFunction · 0.85

Calls 3

lwp_pid_lock_takeFunction · 0.85
lwp_avl_traversalFunction · 0.85
lwp_pid_lock_releaseFunction · 0.85

Tested by

no test coverage detected