summaryrefslogtreecommitdiff
path: root/tests/threadpool-test.c
Commit message (Collapse)AuthorAgeFilesLines
* threadpool-test: Fix leaks in testsStef Walter2013-11-111-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=711751
* Remove a bunch of lingering g_thread_init()Ryan Lortie2013-05-311-2/+0
| | | | | | | | | After this patch, there is but one remaining use of g_thread_init(), which is in tests/slice-threadinit.c, a testcase dedicated to testing the functionality of gslice across a g_thread_init() boundary. This testcase is pretty meaningless these days... probably we should delete it.
* Fix more warning-addition falloutSimon McVittie2012-11-021-1/+1
| | | | | | | | I'm normally a big fan of small atomic commits, but I also want to get things done this afternoon... Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441 Reviewed-by: Colin Walters <walters@verbum.org>
* Improve threadpool test coverageMatthias Clasen2012-08-181-1/+5
|
* fix warningsDan Winship2012-04-301-5/+11
|
* Don't use g_thread_foreach in testsMatthias Clasen2011-10-021-27/+3
|
* Make threads mandatoryDan Winship2011-09-091-5/+0
| | | | | | | | | | G_THREADS_ENABLED still exists, but is always defined. It is still possible to use libglib without threads, but gobject (and everything above it) is now guaranteed to be using threads (as, in fact, it was before, since it was accidentally impossible to compile with --disable-threads). https://bugzilla.gnome.org/show_bug.cgi?id=616754
* Spelling fixesMatthias Clasen2011-08-291-2/+2
| | | | | Spelling fixes in comments and docs, provided by Kjartan Maraas in bug 657336.
* wait longer in threadpool test caseRyan Lortie2011-07-201-3/+10
| | | | | | | | If we are going to fail an assert, wait for a bit longer before doing so (up to 5 seconds, if needed). This is a long-standing Debian patch to fix build failures on really slow machines.
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch svn path=/trunk/; revision=7092
* Grab thread_counter_pools LOCK when increasing leftover_task_counter.Sebastian Wilhelmi2008-01-291-75/+78
| | | | | | | | | | 2008-01-29 Sebastian Wilhelmi <wilhelmi@google.com> * tests/threadpool-test.c (test_thread_pools): Grab thread_counter_pools LOCK when increasing leftover_task_counter. Fixes race in test. (#512624, Simon Murray) svn path=/trunk/; revision=6406
* Stop unused threads before the last test, to make the test terminateMatthias Clasen2007-05-031-1/+4
| | | | | | | | | * tests/threadpool-test.c: Stop unused threads before the last test, to make the test terminate reliably. svn path=/trunk/; revision=5477
* (test_thread_stop_unused): Removed anMartyn James Russell2006-04-071-3/+0
| | | | assertion which can fail and is not a critical test.
* Make sure g_thread_pool_stop_unused_threads() actually stops unusedMartyn James Russell2006-04-071-10/+126
| | | | | | | | | | | | | * 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().
* Updated the documentation to explain that when the maximum threads is > 1Martyn James Russell2006-03-241-10/+35
| | | | | | | | | | | * glib/gthreadpool.c: Updated the documentation to explain that when the maximum threads is > 1 the sort functionality is not 100% accurate due to the ramdom nature of the scheduler choosing which threads to execute. Fixes bug #334943. * tests/threadpool-test.c: Disabled the debugging by default and fixed the sort test to set the maximum threads to 1 to guarantee the thread entry function is called in order.
* To avoid deadlocks get rid of the settings G_LOCK. Use theSebastian Wilhelmi2006-01-171-35/+39
| | | | | | | | | | | | | | | 2006-01-17 Sebastian Wilhelmi <seppi@seppi.de> * glib/gthreadpool.c: To avoid deadlocks get rid of the settings G_LOCK. Use the unused_thread_queue lock instead. Change g_thread_pool_thread_proxy such that threads only wait on non-exlusive pools for at most a 1/2 second. Do not reorder tasks due to superfluous tasks. Global tasks wait at most for max-idle-time milliseconds. Make sure, that no task is woken up twice for the same event via a wakeup_serial. This fixes #324228. * tests/threadpool-test.c: Adapt test accordingly. Do not pass invalid NULL into the thread pools. This as well fixes #327290.
* - Added new API g_thread_pool_get_idle_time() andMartyn James Russell2006-01-031-12/+97
| | | | | | | | | | | | * docs/reference/glib/glib-sections.txt: * glib/glib.symbols: * glib/gthreadpool.[ch]: - Added new API g_thread_pool_get_idle_time() and g_thread_pool_set_idle_time(). (#324228). * tests/threadpool-test.c: - Updated test case to do thread pool sorting, thread pool with no sorting and a thread pool with idle thread timeouts.
* New function to sort tasks pushed into a threadpool. (#324479, MartynMatthias Clasen2005-12-211-23/+206
| | | | | | | | | | | 2005-12-20 Matthias Clasen <mclasen@redhat.com> * glib/glib.symbols: * glib/gthreadpool.h: * glib/gthreadpool.c (g_thread_pool_set_sort_function): New function to sort tasks pushed into a threadpool. (#324479, Martyn Russell) * tests/threadpool-test.c: Test this.
* Don't get stuck in here if immediate is TRUE. (#310954, Hong Jen Yee)Matthias Clasen2005-07-201-2/+5
| | | | | | | | | | 2005-07-20 Matthias Clasen <mclasen@redhat.com> * glib/gthreadpool.c (g_thread_pool_free): Don't get stuck in here if immediate is TRUE. (#310954, Hong Jen Yee) * tests/threadpool-test.c (main): Test immediate == TRUE.
* Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN throughout theSebastian Wilhelmi2002-07-041-0/+3
| | | | | | | 2002-07-04 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN throughout the files, which didn't already have them. (#87312)
* Renamed g_thread_create to g_thread_create_full and added macroSebastian Wilhelmi2001-05-181-6/+3
| | | | | | | | | | | | | | | | | 2001-05-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gthread.c, gthread.h: Renamed g_thread_create to g_thread_create_full and added macro g_thread_create, which omits 'stack_size', 'bound' and 'priority' parameters. Also removed 'bound' from GThread struct. * gthreadpool.h, gthreadpool.c: Adapted GThreadPool to the above changes. GThreadPool lost the 'priority' and 'bound' members. g_thread_pool_new the 'stack_size', 'bound' and 'priority' parameters. * tests/mainloop-test.c, tests/thread-test.c, tests/threadpool-test.c: Adapted to the above changes.
* Moved determination of G_THREAD_FLAGS before G_THREAD_LIBS. Check forSebastian Wilhelmi2000-09-281-2/+2
| | | | | | | | | | | | | | | | | | 2000-09-28 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * configure.in: Moved determination of G_THREAD_FLAGS before G_THREAD_LIBS. Check for UnixWare systems and set the right cflags and libs there (it needs -Kthread for the native compiler and -pthread for gcc). Thanks to Boyd Lynn Gerber <gerberb@zenez.com> for the info. * configure.in: Fail immediately, when no thread library is found, instead of continuing searching for rt libs etc. Changed almost all occurances of $enable_threads to $have_threads, as that's, what we want. * tests/threadpool-test.c: Define vars inside the guard to avoid warnings.
* Include gerror.h before it is used for some g_thread_* functions.Sebastian Wilhelmi2000-09-011-6/+6
| | | | | | | | | | | | | | | | | 2000-09-01 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * glib.h: Include gerror.h before it is used for some g_thread_* functions. * gthread.c, gthreadpool.c, glib.h: Enable error reporting for thread creation, namly for g_thread_create, g_thread_pool_new, g_thread_pool_push and g_thread_pool_set_max_threads. * tests/thread-test.c, tests/threadpool-test.c: Adapted accordingly. * gthread-posix.c (g_thread_create_posix_impl): Use GError to report errors.
* New File implementing an asynchronous queue to be used for asynchronousSebastian Wilhelmi2000-04-281-0/+57
2000-04-28 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gasyncqueue.c: New File implementing an asynchronous queue to be used for asynchronous inter-thread communication. * gthreadpool.c: New File implementing a thread pool to be used for distributing work among several threads. * glib.h: Added the type and function declarations for these two types. * tests/threadpool-test.c: New File implementing a test for the thread pool. This also checks the asynchronous queue underlying the thread pool. * tests/Makefile.am: Changed accordingly.