Grab thread_counter_pools LOCK when increasing leftover_task_counter.

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
This commit is contained in:
Sebastian Wilhelmi 2008-01-29 10:07:07 +00:00 committed by Sebastian Wilhelmi
parent 757fc3f0a5
commit fa7351324a
2 changed files with 84 additions and 75 deletions

View File

@ -1,3 +1,9 @@
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)
2008-01-28 Matthias Clasen <mclasen@redhat.com>
* configure.in: Bump version

View File

@ -186,7 +186,10 @@ test_thread_pools (void)
g_thread_pool_push (pool1, GUINT_TO_POINTER (i + 1), NULL);
g_thread_pool_push (pool2, GUINT_TO_POINTER (i + 1), NULL);
g_thread_pool_push (pool3, GUINT_TO_POINTER (i + 1), NULL);
G_LOCK (thread_counter_pools);
leftover_task_counter += 3;
G_UNLOCK (thread_counter_pools);
}
g_thread_pool_free (pool1, TRUE, TRUE);