| 18 | } |
| 19 | |
| 20 | task<> g(user_data_channel &ch) { |
| 21 | printf("g() is running...\n"); |
| 22 | |
| 23 | auto io = timeout(999s); |
| 24 | co_await ch.release(io.user_data()); // cancel by others |
| 25 | |
| 26 | int result = co_await io; |
| 27 | |
| 28 | if (result < 0) [[likely]] { |
| 29 | printf("g() got error: %d %s\n", result, strerror(-result)); |
| 30 | } else { |
| 31 | printf("g() got result: %d\n", result); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | task<> f() { |
| 36 | user_data_channel ch; |