Lines Matching refs:w

49 static void uv__cancelled(struct uv__work* w) {  in uv__cancelled()  argument
58 struct uv__work* w; in worker() local
121 w = uv__queue_data(q, struct uv__work, wq); in worker()
122 w->work(w); in worker()
124 uv_mutex_lock(&w->loop->wq_mutex); in worker()
125 w->work = NULL; /* Signal uv_cancel() that the work req is done in worker()
127 uv__queue_insert_tail(&w->loop->wq, &w->wq); in worker()
128 uv_async_send(&w->loop->wq_async); in worker()
129 uv_mutex_unlock(&w->loop->wq_mutex); in worker()
266 struct uv__work* w, in uv__work_submit() argument
268 void (*work)(struct uv__work* w), in uv__work_submit() argument
269 void (*done)(struct uv__work* w, int status)) { in uv__work_submit() argument
271 w->loop = loop; in uv__work_submit()
272 w->work = work; in uv__work_submit()
273 w->done = done; in uv__work_submit()
274 post(&w->wq, kind); in uv__work_submit()
281 static int uv__work_cancel(uv_loop_t* loop, uv_req_t* req, struct uv__work* w) { in uv__work_cancel() argument
286 uv_mutex_lock(&w->loop->wq_mutex); in uv__work_cancel()
288 cancelled = !uv__queue_empty(&w->wq) && w->work != NULL; in uv__work_cancel()
290 uv__queue_remove(&w->wq); in uv__work_cancel()
292 uv_mutex_unlock(&w->loop->wq_mutex); in uv__work_cancel()
298 w->work = uv__cancelled; in uv__work_cancel()
300 uv__queue_insert_tail(&loop->wq, &w->wq); in uv__work_cancel()
309 struct uv__work* w; in uv__work_done() local
327 w = container_of(q, struct uv__work, wq); in uv__work_done()
328 err = (w->work == uv__cancelled) ? UV_ECANCELED : 0; in uv__work_done()
329 w->done(w, err); in uv__work_done()
348 static void uv__queue_work(struct uv__work* w) { in uv__queue_work() argument
349 uv_work_t* req = container_of(w, uv_work_t, work_req); in uv__queue_work()
355 static void uv__queue_done(struct uv__work* w, int err) { in uv__queue_done() argument
358 req = container_of(w, uv_work_t, work_req); in uv__queue_done()