Shell c0b0838892 feat: support PID iteration
This change introduces the `lwp_pid_for_each` function, which provides a
convenient and thread-safe method for iterating over PIDs with a user-
defined callback. This addition is necessary to support cases where
operations must be performed on each PID in the balanced tree, enhancing
flexibility and modularity for PID management.

Changes:
- Added `lwp_pid_for_each` function in `lwp_pid.c` to allow iteration
  over PIDs using a callback function and optional data parameter.
- Defined a new internal `pid_foreach_param` structure to encapsulate
  the callback and data for the iteration.
- Added `_before_cb` helper function for executing the callback on each
  PID node during AVL traversal.
- Ensured thread safety by acquiring and releasing the PID lock around
  the AVL traversal within `lwp_pid_for_each`.
- Updated `lwp_pid.h` with the `lwp_pid_for_each` function prototype and
  included `rtthread.h` for necessary types.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
..
2024-12-20 17:50:00 -05:00
2024-03-28 23:42:56 +08:00
2024-03-28 23:42:56 +08:00
2022-12-03 12:07:44 +08:00
2022-12-03 12:07:44 +08:00
2022-12-03 12:07:44 +08:00
2024-03-28 23:42:56 +08:00
2024-02-23 17:49:15 +08:00
2023-11-10 21:37:07 +08:00
2024-02-23 17:49:15 +08:00
2024-03-28 23:42:56 +08:00
2022-12-03 12:07:44 +08:00
2022-12-03 12:07:44 +08:00
2025-01-06 19:34:16 +08:00
2025-01-06 19:34:16 +08:00
2024-03-28 23:42:56 +08:00
2023-10-17 13:07:59 +08:00
2022-12-03 12:07:44 +08:00
2024-03-28 23:42:56 +08:00
2024-03-28 23:42:56 +08:00
2024-12-20 17:50:00 -05:00
2024-12-20 17:50:00 -05:00