summaryrefslogtreecommitdiff
path: root/glib/gasyncqueue.c
Commit message (Collapse)AuthorAgeFilesLines
* doc: Correctly annotate GAsyncQueue methodsEmmanuele Bassi2022-10-131-15/+19
| | | | | Generic pointers are assumed to be nullable unless explicitly marked as not nullable.
* glib: Add SPDX license headers automaticallyPhilip Withnall2022-05-181-0/+2
| | | | | | | | | | | | | | Add SPDX license (but not copyright) headers to all files which follow a certain pattern in their existing non-machine-readable header comment. This commit was entirely generated using the command: ``` git ls-files glib/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs' ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
* docs: Break gtk-doc stanzas into paragraphsEmmanuele Bassi2021-08-021-3/+3
| | | | Keep the first paragraph short, to act as a summary.
* gasyncqueue: Add missing (nullable) annotation to free functionPhilip Withnall2021-07-011-1/+1
| | | | | | | As spotted by Nitin Wartkar in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2170#note_1195878. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* gasyncqueue: Add missing (transfer) and (nullable) return annotationsPhilip Withnall2020-12-121-6/+6
| | | | | | | | | | This commit only looks at the `Returns:` lines in the documentation, and has examined all of them in the file. Function arguments have not been checked. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2227
* glib: Stop mentioning deprecated g_get_current_time() in docsPhilip Withnall2019-07-291-2/+2
| | | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #1438
* gasyncqueue: Ignore use of deprecated types in deprecated APIsPhilip Withnall2019-07-291-0/+4
| | | | | | | | It’s unavoidable. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #1438
* gasyncqueue: Add missing precondition to g_async_queue_timeout_pop()Philip Withnall2018-07-301-0/+4
| | | | | | | | And g_async_queue_timeout_pop_unlocked(). Signed-off-by: Philip Withnall <philip@tecnocode.co.uk> https://gitlab.gnome.org/GNOME/glib/issues/1459
* glib/: LGPLv2+ -> LGPLv2.1+Sébastien Wilmet2017-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All glib/*.{c,h} files have been processed, as well as gtester-report. 12 of those files are not licensed under LGPL: gbsearcharray.h gconstructor.h glibintl.h gmirroringtable.h gscripttable.h gtranslit-data.h gunibreak.h gunichartables.h gunicomp.h gunidecomp.h valgrind.h win_iconv.c Some of them are generated files, some are licensed under a BSD-style license and win_iconv.c is in the public domain. Sub-directories inside glib/: deprecated/: processed in a previous commit glib-mirroring-tab/: already LGPLv2.1+ gnulib/: not modified, the code is copied from gnulib libcharset/: a copy pcre/: a copy tests/: processed in a previous commit https://bugzilla.gnome.org/show_bug.cgi?id=776504
* Documentation fixupsMatthias Clasen2015-09-211-18/+18
| | | | Various parameter fixups and symbol list additions.
* Remove some questionable documentationMatthias Clasen2015-07-271-2/+2
| | | | | | | A function that takes a lock can certainly block in the sense that it has to wait if the lock is taken. https://bugzilla.gnome.org/show_bug.cgi?id=751751
* GAsyncQueue: Add some useful apiMatthias Clasen2015-06-291-0/+100
| | | | | | | The underlying queue supports removing and pushing items to the front, and these operations can sometimes be useful. https://bugzilla.gnome.org/show_bug.cgi?id=751160
* asyncqueue: fix timeout math on 32bit systemsRyan Lortie2014-02-231-4/+2
| | | | | | | | | | | 88182d375e13ae6519a288d5295220c83ca27e73 caught this issue in g_async_queue_timed_pop() but failed to fix the same bug in the _unlocked() variant. This is only a problem on 32bit systems. On 64bit systems, the tv_sec in a timeval is already 64 bits, so no overflow occurs. https://bugzilla.gnome.org/show_bug.cgi?id=722604
* docs: use "Returns:" consistentlyWilliam Jon McCann2014-02-191-12/+12
| | | | Instead of "Return value:".
* Annotate all examples with their languageMatthias Clasen2014-02-011-1/+1
| | | | The C ones, at least.
* docs: Stop using the function tagMatthias Clasen2014-02-011-3/+3
|
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* Fix malformed GTK-Doc comment blocks: invalid parameters and tags.Dieter Verfaillie2012-04-051-2/+2
| | | | | | | | Found these thanks to the improved gobject-introspection GTK-Doc comment block/annotation parser. See https://bugzilla.gnome.org/show_bug.cgi?id=672254 https://bugzilla.gnome.org/show_bug.cgi?id=673385
* gasyncqueue: fix a 32bit overflow in g_async_queue_timed_popDan Winship2012-02-221-1/+1
| | | | | | | also, add a test for g_async_queue_timed_pop() and g_async_queue_timeout_pop() to tests/asyncqueue.c https://bugzilla.gnome.org/show_bug.cgi?id=669670
* docs: Fix g_async_queue_timeout_pop_unlocked typoDavid King2012-02-211-1/+1
|
* gasyncqueue: deprecate GTimeVal-based methods, add relative-delay onesDan Winship2012-02-131-11/+94
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=669670
* Include genviron.h where necessaryMatthias Clasen2011-10-151-0/+1
|
* GAsyncQueue: properly set free functionRyan Lortie2011-10-031-1/+1
| | | | | | | | | | The copying of code from g_async_queue_new() to g_async_queue_new_full() in ef08aa786bca87c520ef319b97df4b3ed0782233 copied the setting of the free function to NULL (instead of the one passed in by the user). Fix that up so that the test passes again. https://bugzilla.gnome.org/show_bug.cgi?id=660843
* GAsyncQueue: simplify an internal functionMatthias Clasen2011-10-011-20/+7
| | | | | | g_cond_timed_wait() behaves like g_cond_wait() when given NULL, so no need have different branches for that in g_async_queue_pop_intern_unlocked().
* GAsyncQueue: internal cleanupMatthias Clasen2011-10-011-8/+8
| | | | | Turn the 'try' parameter of g_async_queue_pop_intern_unlocked into a 'wait', for better alignment with the GCond api.
* GAsyncQueue: embed the GCondMatthias Clasen2011-10-011-11/+7
| | | | Use g_cond_init/clear, now that we have them.
* GAsyncQueue: Cosmetic fixesMatthias Clasen2011-10-011-233/+263
| | | | Mostly doc formatting and whitespace fixes.
* GAsyncQueue: Move private API to a private headerMatthias Clasen2011-10-011-0/+1
|
* libglib: stop using g_mutex_newRyan Lortie2011-09-211-23/+23
| | | | Use G_MUTEX_INIT or g_mutex_init() as appropriate.
* Volatile not necessary after allMatthias Clasen2011-05-281-1/+1
| | | | I was temporarily confused.
* GAsyncQueue: Make ref_count a volatile gintMatthias Clasen2011-05-281-1/+1
|
* GAsyncQueue: Remove excessive atomic operationsMatthias Clasen2011-05-281-17/+0
| | | | | Almost every function was double-checking the ref count, unnecessarily.
* Correct gtk-doc SECTION: syntaxJohan Dahlin2011-02-011-1/+1
| | | | | g-ir-scanner does not allow a space between the : and the section name.
* GAsyncQueue: use g_queue_init() not g_queue_new()Havoc Pennington2010-08-131-14/+14
| | | | | | | By using g_queue_init() instead of g_queue_new(), we can avoid a separate memory allocation. Bug 626704
* Move GAsyncQueue docs inlineMatthias Clasen2010-07-101-0/+53
|
* glib/: fully remove galias hacksRyan Lortie2010-07-071-4/+0
|
* Clean Glib header #include issues: gasyncqueueJavier Jardón2010-05-061-1/+7
|
* Documentation updatesMatthias Clasen2008-02-231-0/+1
| | | | svn path=/trunk/; revision=6561
* add g_async_queue_new_full() which takes a GDestroyNotify function to freeTim-Philipp Müller2007-12-181-0/+23
| | | | | | | | | | | | * docs/reference/glib/glib-sections.txt: * glib/gasyncqueue.c: (g_async_queue_new), (g_async_queue_new_full), (g_async_queue_unref): * glib/gasyncqueue.h: add g_async_queue_new_full() which takes a GDestroyNotify function to free any remaining queue items when the queue is destroyed after the final atomic unref (#367550). svn path=/trunk/; revision=6152
* Require gtk-doc 1.8.Matthias Clasen2007-11-251-2/+2
| | | | | | | | | | | | | | | | | | | 2007-11-25 Matthias Clasen <mclasen@redhat.com> * configure.in: Require gtk-doc 1.8. * glib/gasyncqueue.c: * glib/gdate.c: * glib/gfileutils.c: * glib/gmain.c: * glib/gmarkup.c: * glib/gregex.c: * glib/gtestutils.c: * glib/gutils.c: Use gtk-doc abbreviations for examples in doc comments. svn path=/trunk/; revision=5933
* Make sure g_thread_pool_stop_unused_threads() actually stops unusedMartyn James Russell2006-04-071-0/+13
| | | | | | | | | | | | | * glib/gthreadpool.c: Make sure g_thread_pool_stop_unused_threads() actually stops unused threads and global limits (like max idle time and max unused threads) can be set without creating a thread pool first. Fixed #335215 (patch from Chris Wilson). * tests/threadpool-test.c: Added two new tests, tests setting global limits before creating a thread pool. The second test makes sure unused threads are actually stopped when using the g_thread_pool_stop_unused_threads().
* use standard_calloc to allocate the profile_data. (#335209, Chris Wilson)Matthias Clasen2006-03-201-7/+8
| | | | | | | | | | | | | | | | | | 2006-03-20 Matthias Clasen <mclasen@redhat.com> * glib/gmem.c (profiler_log): use standard_calloc to allocate the profile_data. (#335209, Chris Wilson) * glib/gmain.c (g_main_context_unref): Avoid a deadlock. (#335207, Chris Wilson) Minor optimizations (#335216, Chris Wilson): * glib/gasyncqueue.c (g_async_queue_pop_intern_unlocked): Use g_queue_peek_tail_link instead of g_queue_peek_tail. * glib/glist.c: * glib/gslist.c: Avoid some memset calls.
* Signal waiting threads, problem noticed by Christian Kellner.Matthias Clasen2006-01-161-0/+2
| | | | | | | 2006-01-16 Matthias Clasen <mclasen@redhat.com> * glib/gasyncqueue.c (g_async_queue_push_sorted_unlocked): Signal waiting threads, problem noticed by Christian Kellner.
* - Call g_queue_insert_sorted() instead of duplicating the code. - CallMartyn James Russell2005-12-071-19/+29
| | | | | | | | | | | | | * glib/gasyncqueue.c: - Call g_queue_insert_sorted() instead of duplicating the code. - Call g_queue_sort() instead of duplicating the code. - Invert sort function results to make sure the same sort function gives the same results across glist, gslist, gqueue and gasyncqueue. * tests/asyncqueue-test.c: - Updated the sort function to reflect the example in the documentation for gasyncqueue.c.
* - Added support for sorting async queues by with _push_sorted(),Martyn James Russell2005-12-051-0/+160
| | | | | | | | | | | * docs/reference/glib/glib-sections.txt: * glib/gasyncqueue.[ch]: - Added support for sorting async queues by with _push_sorted(), _push_sorted_unlocked(), _sort() and _sort_unlocked() (#323047). * tests/Makefile.am: * tests/asyncqueue-test.c: - Added test case for gasyncqueue.c
* Add some docs.Matthias Clasen2005-12-051-0/+8
| | | | | | 2005-12-05 Matthias Clasen <mclasen@redhat.com> * glib/gasyncqueue.c: Add some docs.
* Make PLT-reduction work with gcc4, and don't include everything inMatthias Clasen2005-03-141-1/+3
| | | | | | | | | | | | | | | | | 2005-03-13 Matthias Clasen <mclasen@redhat.com> Make PLT-reduction work with gcc4, and don't include everything in galias.h: * glib/glib.symbols: Group symbols by header and source file. * glib/makegalias.pl: Protect definitions by the same preprocessor symbols used to guard the headers. Move the alias declarations to a separate file which is produced when calling makegalias.pl -def * glib/Makefile.am (galiasdef.c): Add a rule to generate this file. * glib/*.c: Include galias.h after the other GLib headers, include galiasdef.c at the bottom.
* glib/gasyncqueue.c glib/ghook.c g_return_if_fail -> g_return_val_if_failManish Singh2004-11-081-2/+2
| | | | | | | | | | | Mon Nov 8 10:45:50 2004 Manish Singh <yosh@gimp.org> * glib/gasyncqueue.c * glib/ghook.c * glib/giochannel.c: g_return_if_fail -> g_return_val_if_fail * glib/gmain.c: Ditto, plus also make g_main_context_ref() actually return the passed in pointer.
* Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(),Matthias Clasen2004-11-081-1/+5
| | | | | | | | | | | 2004-11-08 Matthias Clasen <mclasen@redhat.com> * glib/gasyncqueue.[hc]: * glib/ghook.[hc]: * glib/gmain.[hc]: * glib/giochannel.[hc]: Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(), g_async_queue_ref() return the passed in pointer. (#151663, Manish Singh)
* Apply a patch to fix sparse warnings. (#154696, Kjartan Maraas)Matthias Clasen2004-10-241-1/+1
| | | | | | | | | 2004-10-23 Matthias Clasen <mclasen@redhat.com> * glib/gasyncqueue.c, glib/gatomic.c, glib/gdate.c, glib/giochannel.c, glib/gmain.c, glib/gspawn.c, glib/libcharset/localcharset.c: Apply a patch to fix sparse warnings. (#154696, Kjartan Maraas)