| 57 | } |
| 58 | |
| 59 | static void done_safely(struct rt_completion *completion) |
| 60 | { |
| 61 | rt_err_t error; |
| 62 | |
| 63 | /* Signal completion */ |
| 64 | error = rt_completion_wakeup(completion); |
| 65 | |
| 66 | /* try again if failed to produce */ |
| 67 | if (error == -RT_EEMPTY) |
| 68 | { |
| 69 | rt_thread_yield(); |
| 70 | } |
| 71 | else if (error) |
| 72 | { |
| 73 | uassert_true(error == RT_EOK); |
| 74 | _test_thread_exit_failure("unexpected error"); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | static void wait_safely(struct rt_completion *completion) |
| 79 | { |
no test coverage detected