Lines Matching refs:state

231   uv__cf_loop_state_t* state;
237 state = loop->cf_state;
238 assert(state != NULL);
242 uv_mutex_lock(&state->fsevent_mutex);
243 QUEUE_FOREACH(q, &state->fsevent_handles) {
329 uv_mutex_unlock(&state->fsevent_mutex);
335 uv__cf_loop_state_t* state;
376 state = loop->cf_state;
378 state->loop,
386 state->fsevent_stream = ref;
393 uv__cf_loop_state_t* state;
395 state = loop->cf_state;
397 if (state->fsevent_stream == NULL)
401 pFSEventStreamStop(state->fsevent_stream);
404 pFSEventStreamInvalidate(state->fsevent_stream);
405 pFSEventStreamRelease(state->fsevent_stream);
406 state->fsevent_stream = NULL;
413 uv__cf_loop_state_t* state;
422 state = handle->loop->cf_state;
432 uv_mutex_lock(&state->fsevent_mutex);
433 if (state->fsevent_need_reschedule == 0) {
434 uv_mutex_unlock(&state->fsevent_mutex);
437 state->fsevent_need_reschedule = 0;
438 uv_mutex_unlock(&state->fsevent_mutex);
447 uv_mutex_lock(&state->fsevent_mutex);
448 path_count = state->fsevent_handle_count;
452 uv_mutex_unlock(&state->fsevent_mutex);
456 q = &state->fsevent_handles;
459 assert(q != &state->fsevent_handles);
466 uv_mutex_unlock(&state->fsevent_mutex);
471 uv_mutex_unlock(&state->fsevent_mutex);
497 uv_mutex_lock(&state->fsevent_mutex);
498 QUEUE_FOREACH(q, &state->fsevent_handles) {
502 uv_mutex_unlock(&state->fsevent_mutex);
512 uv_sem_post(&state->fsevent_sem);
597 uv__cf_loop_state_t* state;
608 state = uv__calloc(1, sizeof(*state));
609 if (state == NULL)
622 err = uv_sem_init(&state->fsevent_sem, 0);
626 err = uv_mutex_init(&state->fsevent_mutex);
630 QUEUE_INIT(&state->fsevent_handles);
631 state->fsevent_need_reschedule = 0;
632 state->fsevent_handle_count = 0;
637 state->signal_source = pCFRunLoopSourceCreate(NULL, 0, &ctx);
638 if (state->signal_source == NULL) {
649 loop->cf_state = state;
668 uv_mutex_destroy(&state->fsevent_mutex);
671 uv_sem_destroy(&state->fsevent_sem);
680 uv__free(state);
688 uv__cf_loop_state_t* state;
709 /* Destroy state */
710 state = loop->cf_state;
711 uv_sem_destroy(&state->fsevent_sem);
712 uv_mutex_destroy(&state->fsevent_mutex);
713 pCFRelease(state->signal_source);
714 uv__free(state);
722 uv__cf_loop_state_t* state;
725 state = loop->cf_state;
726 state->loop = pCFRunLoopGetCurrent();
728 pCFRunLoopAddSource(state->loop,
729 state->signal_source,
735 pCFRunLoopRemoveSource(state->loop,
736 state->signal_source,
739 state->loop = NULL;
748 uv__cf_loop_state_t* state;
754 state = loop->cf_state;
768 pCFRunLoopStop(state->loop);
782 uv__cf_loop_state_t* state;
794 state = loop->cf_state;
795 assert(state != NULL);
796 pCFRunLoopSourceSignal(state->signal_source);
797 pCFRunLoopWakeUp(state->loop);
808 uv__cf_loop_state_t* state;
844 state = handle->loop->cf_state;
845 uv_mutex_lock(&state->fsevent_mutex);
846 QUEUE_INSERT_TAIL(&state->fsevent_handles, &handle->cf_member);
847 state->fsevent_handle_count++;
848 state->fsevent_need_reschedule = 1;
849 uv_mutex_unlock(&state->fsevent_mutex);
878 uv__cf_loop_state_t* state;
884 state = handle->loop->cf_state;
885 uv_mutex_lock(&state->fsevent_mutex);
887 state->fsevent_handle_count--;
888 state->fsevent_need_reschedule = 1;
889 uv_mutex_unlock(&state->fsevent_mutex);
898 uv_sem_wait(&state->fsevent_sem);