gasyncqueue.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* GLIB - Library of useful routines for C programming
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*
  18. * Modified by the GLib Team and others 1997-2000. See the AUTHORS
  19. * file for a list of people on the GLib Team. See the ChangeLog
  20. * files for a list of changes. These files are distributed with
  21. * GLib at ftp://ftp.gtk.org/pub/gtk/.
  22. */
  23. #ifndef __G_ASYNCQUEUE_H__
  24. #define __G_ASYNCQUEUE_H__
  25. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  26. #error "Only <glib.h> can be included directly."
  27. #endif
  28. #include <glib/gthread.h>
  29. G_BEGIN_DECLS
  30. typedef struct _GAsyncQueue GAsyncQueue;
  31. GLIB_AVAILABLE_IN_ALL
  32. GAsyncQueue *g_async_queue_new (void);
  33. GLIB_AVAILABLE_IN_ALL
  34. GAsyncQueue *g_async_queue_new_full (GDestroyNotify item_free_func);
  35. GLIB_AVAILABLE_IN_ALL
  36. void g_async_queue_lock (GAsyncQueue *queue);
  37. GLIB_AVAILABLE_IN_ALL
  38. void g_async_queue_unlock (GAsyncQueue *queue);
  39. GLIB_AVAILABLE_IN_ALL
  40. GAsyncQueue *g_async_queue_ref (GAsyncQueue *queue);
  41. GLIB_AVAILABLE_IN_ALL
  42. void g_async_queue_unref (GAsyncQueue *queue);
  43. GLIB_DEPRECATED_FOR(g_async_queue_ref)
  44. void g_async_queue_ref_unlocked (GAsyncQueue *queue);
  45. GLIB_DEPRECATED_FOR(g_async_queue_unref)
  46. void g_async_queue_unref_and_unlock (GAsyncQueue *queue);
  47. GLIB_AVAILABLE_IN_ALL
  48. void g_async_queue_push (GAsyncQueue *queue,
  49. gpointer data);
  50. GLIB_AVAILABLE_IN_ALL
  51. void g_async_queue_push_unlocked (GAsyncQueue *queue,
  52. gpointer data);
  53. GLIB_AVAILABLE_IN_ALL
  54. void g_async_queue_push_sorted (GAsyncQueue *queue,
  55. gpointer data,
  56. GCompareDataFunc func,
  57. gpointer user_data);
  58. GLIB_AVAILABLE_IN_ALL
  59. void g_async_queue_push_sorted_unlocked (GAsyncQueue *queue,
  60. gpointer data,
  61. GCompareDataFunc func,
  62. gpointer user_data);
  63. GLIB_AVAILABLE_IN_ALL
  64. gpointer g_async_queue_pop (GAsyncQueue *queue);
  65. GLIB_AVAILABLE_IN_ALL
  66. gpointer g_async_queue_pop_unlocked (GAsyncQueue *queue);
  67. GLIB_AVAILABLE_IN_ALL
  68. gpointer g_async_queue_try_pop (GAsyncQueue *queue);
  69. GLIB_AVAILABLE_IN_ALL
  70. gpointer g_async_queue_try_pop_unlocked (GAsyncQueue *queue);
  71. GLIB_AVAILABLE_IN_ALL
  72. gpointer g_async_queue_timeout_pop (GAsyncQueue *queue,
  73. guint64 timeout);
  74. GLIB_AVAILABLE_IN_ALL
  75. gpointer g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue,
  76. guint64 timeout);
  77. GLIB_AVAILABLE_IN_ALL
  78. gint g_async_queue_length (GAsyncQueue *queue);
  79. GLIB_AVAILABLE_IN_ALL
  80. gint g_async_queue_length_unlocked (GAsyncQueue *queue);
  81. GLIB_AVAILABLE_IN_ALL
  82. void g_async_queue_sort (GAsyncQueue *queue,
  83. GCompareDataFunc func,
  84. gpointer user_data);
  85. GLIB_AVAILABLE_IN_ALL
  86. void g_async_queue_sort_unlocked (GAsyncQueue *queue,
  87. GCompareDataFunc func,
  88. gpointer user_data);
  89. GLIB_AVAILABLE_IN_2_46
  90. gboolean g_async_queue_remove (GAsyncQueue *queue,
  91. gpointer item);
  92. GLIB_AVAILABLE_IN_2_46
  93. gboolean g_async_queue_remove_unlocked (GAsyncQueue *queue,
  94. gpointer item);
  95. GLIB_AVAILABLE_IN_2_46
  96. void g_async_queue_push_front (GAsyncQueue *queue,
  97. gpointer item);
  98. GLIB_AVAILABLE_IN_2_46
  99. void g_async_queue_push_front_unlocked (GAsyncQueue *queue,
  100. gpointer item);
  101. GLIB_DEPRECATED_FOR(g_async_queue_timeout_pop)
  102. gpointer g_async_queue_timed_pop (GAsyncQueue *queue,
  103. GTimeVal *end_time);
  104. GLIB_DEPRECATED_FOR(g_async_queue_timeout_pop_unlocked)
  105. gpointer g_async_queue_timed_pop_unlocked (GAsyncQueue *queue,
  106. GTimeVal *end_time);
  107. G_END_DECLS
  108. #endif /* __G_ASYNCQUEUE_H__ */