evtloop_main.h 700 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2019-2020 Alibaba Group Holding Limited
  3. */
  4. #ifndef _EVENTLOOP_H
  5. #define _EVENTLOOP_H
  6. #include <stdbool.h>
  7. #include "aos/yloop.h"
  8. typedef void (*eventloop_sock_cb)(void);
  9. typedef int (*reader_poll_t)(void *reader, bool setup, void *sem);
  10. typedef struct {
  11. int event;
  12. reader_poll_t poll;
  13. eventloop_sock_cb cb;
  14. } eventloop_sock_t;
  15. /**
  16. * This function will init per-loop event service
  17. * @param[in] void
  18. * @return 0 is OK, -1 is error
  19. */
  20. int eventloop_local_event_init(void);
  21. /**
  22. * This function will deinit per-loop event service
  23. * @param[in] void
  24. * @return 0 is OK, -1 is error
  25. */
  26. int eventloop_local_event_deinit(void);
  27. #endif /* YLOOP_H */