| 44 | |
| 45 | |
| 46 | int uv_async_init(uv_loop_t* loop, uv_async_t* handle, uv_async_cb async_cb) { |
| 47 | int err; |
| 48 | |
| 49 | err = uv__async_start(loop); |
| 50 | if (err) |
| 51 | return err; |
| 52 | |
| 53 | uv__handle_init(loop, (uv_handle_t*)handle, UV_ASYNC); |
| 54 | handle->async_cb = async_cb; |
| 55 | handle->pending = 0; |
| 56 | handle->u.fd = 0; /* This will be used as a busy flag. */ |
| 57 | |
| 58 | uv__queue_insert_tail(&loop->async_handles, &handle->queue); |
| 59 | uv__handle_start(handle); |
| 60 | |
| 61 | return 0; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | int uv_async_send(uv_async_t* handle) { |
no test coverage detected