Lines Matching refs:event
441 if (event_pid_changed(s->event)) in source_io_unregister()
447 if (epoll_ctl(s->event->epoll_fd, EPOLL_CTL_DEL, s->io.fd, NULL) < 0) in source_io_unregister()
468 if (epoll_ctl(s->event->epoll_fd, in source_io_register()
482 if (event_pid_changed(s->event)) in source_child_pidfd_unregister()
489 if (epoll_ctl(s->event->epoll_fd, EPOLL_CTL_DEL, s->child.pidfd, NULL) < 0) in source_child_pidfd_unregister()
507 if (epoll_ctl(s->event->epoll_fd, in source_child_pidfd_register()
770 prioq_reshuffle(s->event->pending, s, &s->pending_index); in event_source_pp_prioq_reshuffle()
773 prioq_reshuffle(s->event->prepare, s, &s->prepare_index); in event_source_pp_prioq_reshuffle()
786 d = &s->event->monotonic; in event_source_time_prioq_reshuffle()
788 assert_se(d = event_get_clock_data(s->event, s->type)); in event_source_time_prioq_reshuffle()
811 sd_event *event; in source_disconnect() local
815 if (!s->event) in source_disconnect()
818 assert(s->event->n_sources > 0); in source_disconnect()
839 assert_se(d = event_get_clock_data(s->event, s->type)); in source_disconnect()
848 if (s->event->signal_sources) in source_disconnect()
849 s->event->signal_sources[s->signal.sig] = NULL; in source_disconnect()
851 event_gc_signal_data(s->event, &s->priority, s->signal.sig); in source_disconnect()
857 if (event_pid_changed(s->event)) in source_disconnect()
862 assert(s->event->n_online_child_sources > 0); in source_disconnect()
863 s->event->n_online_child_sources--; in source_disconnect()
866 (void) hashmap_remove(s->event->child_sources, PID_TO_PTR(s->child.pid)); in source_disconnect()
872 event_gc_signal_data(s->event, &s->priority, SIGCHLD); in source_disconnect()
881 set_remove(s->event->post_sources, s); in source_disconnect()
885 prioq_remove(s->event->exit, s, &s->exit.prioq_index); in source_disconnect()
917 event_gc_inode_data(s->event, inode_data); in source_disconnect()
928 prioq_remove(s->event->pending, s, &s->pending_index); in source_disconnect()
931 prioq_remove(s->event->prepare, s, &s->prepare_index); in source_disconnect()
934 event_source_time_prioq_remove(s, &s->event->monotonic); in source_disconnect()
936 event = TAKE_PTR(s->event); in source_disconnect()
937 LIST_REMOVE(sources, event->sources, s); in source_disconnect()
938 event->n_sources--; in source_disconnect()
944 sd_event_unref(event); in source_disconnect()
1013 s->pending_iteration = s->event->iteration; in source_set_pending()
1015 r = prioq_put(s->event->pending, s, &s->pending_index); in source_set_pending()
1021 assert_se(prioq_remove(s->event->pending, s, &s->pending_index)); in source_set_pending()
1029 d = hashmap_get(s->event->signal_data, &s->priority); in source_set_pending()
1061 .event = e, in source_new()
1672 r = prioq_put(s->event->exit, s, &s->exit.prioq_index); in sd_event_add_exit()
1993 static int inotify_exit_callback(sd_event_source *s, const struct inotify_event *event, void *userd… in inotify_exit_callback() argument
2155 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_description()
2163 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_description()
2175 return s->event; in sd_event_source_get_event()
2181 assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); in sd_event_source_get_pending()
2182 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_pending()
2190 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_io_fd()
2201 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_io_fd()
2225 (void) epoll_ctl(s->event->epoll_fd, EPOLL_CTL_DEL, saved_fd, NULL); in sd_event_source_set_io_fd()
2250 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_io_events()
2262 assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); in sd_event_source_set_io_events()
2263 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_io_events()
2289 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_io_revents()
2298 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_signal()
2305 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_priority()
2318 assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); in sd_event_source_set_priority()
2319 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_priority()
2336 r = event_make_inotify_data(s->event, priority, &new_inotify_data); in sd_event_source_set_priority()
2341 …r = event_make_inode_data(s->event, new_inotify_data, old_inode_data->dev, old_inode_data->ino, &n… in sd_event_source_set_priority()
2354 LIST_PREPEND(to_close, s->event->inode_data_to_close, new_inode_data); in sd_event_source_set_priority()
2363 r = inode_data_realize_watch(s->event, new_inode_data); in sd_event_source_set_priority()
2374 event_gc_inode_data(s->event, old_inode_data); in sd_event_source_set_priority()
2382 assert_se(old = hashmap_get(s->event->signal_data, &s->priority)); in sd_event_source_set_priority()
2386 r = event_make_signal_data(s->event, s->signal.sig, &d); in sd_event_source_set_priority()
2392 event_unmask_signal_data(s->event, old, s->signal.sig); in sd_event_source_set_priority()
2399 prioq_reshuffle(s->event->exit, s, &s->exit.prioq_index); in sd_event_source_set_priority()
2405 event_free_inode_data(s->event, new_inode_data); in sd_event_source_set_priority()
2408 event_free_inotify_data(s->event, new_inotify_data); in sd_event_source_set_priority()
2415 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_enabled()
2454 event_gc_signal_data(s->event, &s->priority, s->signal.sig); in event_source_offline()
2459 assert(s->event->n_online_child_sources > 0); in event_source_offline()
2460 s->event->n_online_child_sources--; in event_source_offline()
2466 event_gc_signal_data(s->event, &s->priority, SIGCHLD); in event_source_offline()
2470 prioq_reshuffle(s->event->exit, s, &s->exit.prioq_index); in event_source_offline()
2531 r = event_make_signal_data(s->event, s->signal.sig, NULL); in event_source_online()
2533 event_gc_signal_data(s->event, &s->priority, s->signal.sig); in event_source_online()
2549 r = event_make_signal_data(s->event, SIGCHLD, NULL); in event_source_online()
2551 event_gc_signal_data(s->event, &s->priority, SIGCHLD); in event_source_online()
2557 s->event->n_online_child_sources++; in event_source_online()
2580 prioq_reshuffle(s->event->exit, s, &s->exit.prioq_index); in event_source_online()
2593 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_enabled()
2596 if (s->event->state == SD_EVENT_FINISHED) in sd_event_source_set_enabled()
2625 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_time()
2636 assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); in sd_event_source_set_time()
2637 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_time()
2656 r = sd_event_now(s->event, event_source_type_to_clock(s->type), &t); in sd_event_source_set_time_relative()
2671 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_time_accuracy()
2683 assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); in sd_event_source_set_time_accuracy()
2684 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_time_accuracy()
2703 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_time_clock()
2713 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_child_pid()
2722 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_child_pidfd()
2733 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_send_child_signal()
2815 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_get_inotify_mask()
2826 assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); in sd_event_source_set_prepare()
2827 assert_return(!event_pid_changed(s->event), -ECHILD); in sd_event_source_set_prepare()
2837 r = prioq_ensure_allocated(&s->event->prepare, prepare_prioq_compare); in sd_event_source_set_prepare()
2844 r = prioq_put(s->event->prepare, s, &s->prepare_index); in sd_event_source_set_prepare()
2848 prioq_remove(s->event->prepare, s, &s->prepare_index); in sd_event_source_set_prepare()
2882 r = setup_clock_data(s->event, &s->event->monotonic, CLOCK_MONOTONIC); in event_source_enter_ratelimited()
2890 event_source_time_prioq_remove(s, event_get_clock_data(s->event, s->type)); in event_source_enter_ratelimited()
2893 r = event_source_time_prioq_put(s, &s->event->monotonic); in event_source_enter_ratelimited()
2900 event_source_time_prioq_remove(s, &s->event->monotonic); in event_source_enter_ratelimited()
2913 … assert_se(event_source_time_prioq_put(s, event_get_clock_data(s->event, s->type)) >= 0); in event_source_enter_ratelimited()
2927 event_source_time_prioq_remove(s, &s->event->monotonic); in event_source_leave_ratelimit()
2931 r = event_source_time_prioq_put(s, event_get_clock_data(s->event, s->type)); in event_source_leave_ratelimit()
2941 event_source_time_prioq_remove(s, event_get_clock_data(s->event, s->type)); in event_source_leave_ratelimit()
2963 (void) sd_event_exit(s->event, r); in event_source_leave_ratelimit()
2979 assert_se(event_source_time_prioq_put(s, &s->event->monotonic) >= 0); in event_source_leave_ratelimit()
3547 saved_event = sd_event_ref(s->event); in source_dispatch()
3570 SET_FOREACH(z, s->event->post_sources) { in source_dispatch()
3635 struct sd_event *e = s->event; in source_dispatch()
4460 if (!s->event) /* Already disconnected */ in sd_event_source_set_floating()
4467 sd_event_unref(s->event); in sd_event_source_set_floating()
4469 sd_event_ref(s->event); in sd_event_source_set_floating()