* @brief Wait for an empty PID slot to become available * * @param[in] wait_flags Wait mode flags (RT_INTERRUPTIBLE, RT_KILLABLE or RT_UNINTERRUPTIBLE) * @param[in] to Timeout value in ticks (RT_WAITING_FOREVER for no timeout) * * @return int Error code (0 on success, negative on error) */
| 92 | * @return int Error code (0 on success, negative on error) |
| 93 | */ |
| 94 | int lwp_pid_wait_for_empty(int wait_flags, rt_tick_t to) |
| 95 | { |
| 96 | int error; |
| 97 | |
| 98 | if (wait_flags == RT_INTERRUPTIBLE) |
| 99 | { |
| 100 | error = rt_wqueue_wait_interruptible(&_pid_emptyq, 0, to); |
| 101 | } |
| 102 | else |
| 103 | { |
| 104 | error = rt_wqueue_wait_killable(&_pid_emptyq, 0, to); |
| 105 | } |
| 106 | return error; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * @brief Acquire the PID management mutex lock |
no test coverage detected