|
15 | 15 |
|
16 | 16 | #ifdef TST_TEST_H__ |
17 | 17 |
|
18 | | -/* |
19 | | - * Waits for process state change. |
| 18 | +/** |
| 19 | + * TST_PROCESS_STATE_WAIT() - Waits for a process state change. |
| 20 | + * |
| 21 | + * Polls `/proc/$PID/state` for a process state changes. |
20 | 22 | * |
21 | | - * The state is one of the following: |
| 23 | + * @pid: A process pid. |
| 24 | + * @state: A state to wait for. |
| 25 | + * @msec_timeout: A timeout for the wait. |
22 | 26 | * |
23 | | - * R - process is running |
24 | | - * S - process is sleeping |
25 | | - * D - process sleeping uninterruptibly |
26 | | - * Z - zombie process |
27 | | - * T - process is traced |
| 27 | + * Possible process states (see :manpage:`ps(1)`): |
| 28 | + * |
| 29 | + * - **R** Process is running. |
| 30 | + * - **S** Process is sleeping. |
| 31 | + * - **D** Process sleeping uninterruptibly. |
| 32 | + * - **Z** Zombie process. |
| 33 | + * - **T** Process is traced. |
| 34 | + * - **t** Tracing stopped. |
| 35 | + * - **X** Process id dead. |
28 | 36 | */ |
29 | 37 | #define TST_PROCESS_STATE_WAIT(pid, state, msec_timeout) \ |
30 | 38 | tst_process_state_wait(__FILE__, __LINE__, NULL, \ |
31 | 39 | (pid), (state), (msec_timeout)) |
32 | 40 |
|
33 | | -/* |
34 | | - * Check that a given pid is present on the system |
| 41 | +/** |
| 42 | + * TST_PROCESS_EXIT_WAIT() - Waits while pid is present on the system. |
| 43 | + * |
| 44 | + * Loops until `kill($PID, 0)` succeds or timeout is reached. |
| 45 | + * |
| 46 | + * @pid: A process pid. |
| 47 | + * @msec_timeout: A timeout for the wait. |
35 | 48 | */ |
36 | 49 | #define TST_PROCESS_EXIT_WAIT(pid, msec_timeout) \ |
37 | 50 | tst_process_exit_wait((pid), (msec_timeout)) |
38 | 51 |
|
39 | | -/* |
40 | | - * Waits for thread state change. |
| 52 | +/** |
| 53 | + * TST_THREAD_STATE_WAIT() - Waits for a thread state change. |
| 54 | + * |
| 55 | + * Polls `/proc/self/task/$TID/state` for a thread state change. |
41 | 56 | * |
42 | | - * The state is one of the following: |
| 57 | + * Possible thread states are the same as for TST_PROCESS_STATE_WAIT(). |
43 | 58 | * |
44 | | - * R - running |
45 | | - * S - sleeping |
46 | | - * D - disk sleep |
47 | | - * T - stopped |
48 | | - * t - tracing stopped |
49 | | - * Z - zombie |
50 | | - * X - dead |
| 59 | + * @tid: A thread tid. |
| 60 | + * @state: A state to wait for. |
| 61 | + * @msec_timeout: A timeout for the wait. |
51 | 62 | */ |
52 | 63 | #define TST_THREAD_STATE_WAIT(tid, state, msec_timeout) \ |
53 | 64 | tst_thread_state_wait((tid), (state), (msec_timeout)) |
|
0 commit comments