define the maximum number of threads in the header file.

2005-02-14  Sven Neumann  <sven@gimp.org>

	* app/base/pixel-processor.[ch]: define the maximum number of
	threads in the header file.

	* app/config/gimpbaseconfig.c: use the #define.
This commit is contained in:
Sven Neumann
2005-02-14 00:34:38 +00:00
committed by Sven Neumann
parent 0e1077d61d
commit 9e6fd61f59
4 changed files with 16 additions and 4 deletions

View File

@ -213,7 +213,7 @@ do_parallel_regions_single (PixelProcessor *processor)
return NULL;
}
#define MAX_THREADS 16
#define TILES_PER_THREAD 8
static void
@ -225,7 +225,7 @@ pixel_regions_do_parallel (PixelProcessor *processor)
if (max_threads > 1 && tiles > TILES_PER_THREAD)
{
GThread *threads[MAX_THREADS];
GThread *threads[GIMP_MAX_NUM_THREADS];
gint nthreads = MIN (max_threads, tiles / TILES_PER_THREAD);
gint i;
@ -331,7 +331,7 @@ pixel_processor_set_num_threads (gint num_threads)
{
g_return_if_fail (num_threads > 0);
max_threads = CLAMP (num_threads, 1, MAX_THREADS);
max_threads = CLAMP (num_threads, 1, GIMP_MAX_NUM_THREADS);
}
void