Lines Matching defs:loop

66   uv_loop_t loop;
69 ASSERT_OK(uv_loop_init(&loop));
73 ASSERT_OK(uv_timer_init(&loop, &timer_handle));
75 ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT));
77 ASSERT_OK(uv_loop_close(&loop));
101 * Establish the loop before we fork to make sure that it
135 /* Prime the loop. */
159 printf("Going to run the loop in the child\n");
181 /* Prime the loop. */
190 /* Run the loop AFTER the poll watcher is registered to make sure it
223 printf("Going to run the loop in the child\n");
258 /* Prime the loop. */
277 /* Run the loop, make sure we don't get the signal. */
278 printf("Running loop in parent\n");
290 printf("Running loop in child\n");
303 but isnt running the loop. */
316 /* Prime the loop. */
337 /* Run the loop, make sure we don't get the signal. */
338 printf("Running loop in parent\n");
339 uv_unref((uv_handle_t*)&signal_handle); /* so the loop can exit;
352 printf("Checking loop in child\n");
356 /* Don't run the loop. Wait for the parent to call us */
365 /* Note that we're deliberately not running the loop
366 * in the child, and also not closing the loop's handles,
367 * so the child default loop can't be cleanly closed.
384 uv_loop_t loop;
388 ASSERT_OK(uv_loop_init(&loop));
389 ASSERT_OK(uv_signal_init(&loop, &signal_handle));
398 uv_loop_fork(&loop);
400 uv_run(&loop, UV_RUN_DEFAULT);
405 uv_run(&loop, UV_RUN_ONCE);
408 /* loop should stop after closing the only handle */
410 ASSERT_OK(uv_run(&loop, UV_RUN_DEFAULT));
415 MAKE_VALGRIND_HAPPY(&loop);
484 static void assert_watch_file_current_dir(uv_loop_t* const loop, int file_or_dir) {
493 r = uv_fs_event_init(loop, &fs_event);
503 r = uv_timer_init(loop, &timer);
512 uv_run(loop, UV_RUN_DEFAULT);
521 uv_run(loop, UV_RUN_DEFAULT); /* flush pending closes */
531 uv_loop_t loop;
533 /* Watch in the parent, prime the loop and/or threads. */
547 /* Ee can watch in a new loop, but dirs only work
553 uv_loop_init(&loop);
555 assert_watch_file_current_dir(&loop, file_or_dir);
556 ASSERT_OK(uv_loop_close(&loop));
557 printf("Child second watch default loop\n");
558 /* Ee can watch in the default loop. */
561 * the timer cb fires before the event loop enters uv__io_poll,
568 /* We can close the parent loop successfully too. This is
626 uv_loop_t* loop;
628 loop = uv_default_loop();
634 r = uv_fs_event_init(loop, &fs_event);
642 r = uv_timer_init(loop, &timer);
657 ASSERT_OK(uv_loop_fork(loop));
664 printf("Running loop in child \n");
665 uv_run(loop, UV_RUN_DEFAULT);
674 uv_run(loop, UV_RUN_DEFAULT); /* Flush pending closes. */
678 MAKE_VALGRIND_HAPPY(loop);
699 static void assert_run_work(uv_loop_t* const loop) {
706 r = uv_queue_work(loop, &work_req, work_cb, after_work_cb);
709 uv_run(loop, UV_RUN_DEFAULT);
725 uv_loop_t loop;
731 /* Prime the pool and default loop. */
746 /* Child. We can work in a new loop. */
748 uv_loop_init(&loop);
750 assert_run_work(&loop);
751 uv_loop_close(&loop);
752 printf("Child second watch default loop\n");
753 /* We can work in the default loop. */