xrp_sync_queue.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2018 Cadence Design Systems Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining
  5. * a copy of this software and associated documentation files (the
  6. * "Software"), to deal in the Software without restriction, including
  7. * without limitation the rights to use, copy, modify, merge, publish,
  8. * distribute, sublicense, and/or sell copies of the Software, and to
  9. * permit persons to whom the Software is furnished to do so, subject to
  10. * the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included
  13. * in all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #ifndef _XRP_SYNC_QUEUE_IMPL_H
  24. #define _XRP_SYNC_QUEUE_IMPL_H
  25. #include "xrp_thread_impl.h"
  26. struct xrp_queue_item {
  27. };
  28. struct xrp_request_queue {
  29. void *context;
  30. void (*fn)(struct xrp_queue_item *rq, void *context);
  31. };
  32. struct xrp_event_impl {
  33. xrp_cond cond;
  34. };
  35. void xrp_queue_init(struct xrp_request_queue *queue, int priority,
  36. void *context,
  37. void (*fn)(struct xrp_queue_item *rq, void *context));
  38. void xrp_queue_destroy(struct xrp_request_queue *queue);
  39. void xrp_queue_push(struct xrp_request_queue *queue,
  40. struct xrp_queue_item *rq);
  41. struct xrp_event *xrp_event_create(void);
  42. void xrp_impl_broadcast_event(struct xrp_event *event, enum xrp_status status);
  43. void xrp_impl_release_event(struct xrp_event *event);
  44. #endif