Commit 9e6fd61f authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

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.
parent 0e1077d6
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.
2005-02-14 Sven Neumann <sven@gimp.org>
* app/base/gimphistogram.c
......
......@@ -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
......
......@@ -22,6 +22,9 @@
#define __PIXEL_PROCESSOR_H__
#define GIMP_MAX_NUM_THREADS 16
typedef void (* PixelProcessorFunc) (void);
......
......@@ -28,6 +28,8 @@
#include "config-types.h"
#include "base/pixel-processor.h"
#include "gimprc-blurbs.h"
#include "gimpbaseconfig.h"
......@@ -117,7 +119,7 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
GIMP_CONFIG_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_UINT (object_class, PROP_NUM_PROCESSORS,
"num-processors", NUM_PROCESSORS_BLURB,
1, 16, 2,
1, GIMP_MAX_NUM_THREADS, 2,
0);
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
"tile-cache-size", TILE_CACHE_SIZE_BLURB,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment