summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2011-03-19 04:56:52 +0000
committerMichael Vrhel <michael.vrhel@artifex.com>2011-03-19 04:56:52 +0000
commit924eeb2baac709fe3d68bfbc4b9608b85f309f53 (patch)
treef19c43b352e4afde276a044563fd07c8b8ed8838
parenta94ea6e882b83ea1b0ff0faa4c11410ebef18b19 (diff)
A temp fix for bugs 692038 and 692065. The clist devices that are created for the threads now inherit the icc profile from the target device. I need to set things up so that the device profile is no longer reference counted since we could have a race condition problem if the different threads are incrementing and decrementing the count and if the command is not atomic on a particular architecture. The plan will be to no longer ref count the device profile but to have it maintained until the the actual target device is destroyed. There will be a bit of work to do with respect to the pdf14 device, which can have a device profile that is different than the actual target device. That profile can be altered with the transparency group pushes and pops.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@12303 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/base/gxclthrd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gs/base/gxclthrd.c b/gs/base/gxclthrd.c
index 767d3afb7..a5345d09d 100644
--- a/gs/base/gxclthrd.c
+++ b/gs/base/gxclthrd.c
@@ -149,6 +149,10 @@ clist_setup_render_threads(gx_device *dev, int y)
ndev->PageCount = dev->PageCount; /* copy to prevent mismatch error */
if ((code = gs_putdeviceparams(ndev, (gs_param_list *)&paramlist)) < 0)
break;
+ /* A question is, can the clist instances share the device profile.
+ Only doing reads of this from different threads */
+ ncdev->device_icc_profile = cdev->device_icc_profile;
+ rc_increment(ncdev->device_icc_profile);
ncdev->page_uses_transparency = cdev->page_uses_transparency;
/* gdev_prn_allocate_memory sets the clist for writing, creating new files.
* We need to unlink those files and open the main thread's files, then
@@ -287,6 +291,8 @@ clist_teardown_render_threads(gx_device *dev)
thread_cdev->page_info.io_procs->fclose(thread_cdev->page_cfile, thread_cdev->page_cfname, false);
thread_cdev->do_not_open_or_close_bandfiles = true; /* we already closed the files */
gdev_prn_free_memory((gx_device *)thread_cdev);
+ /* Decrement the rc count on the icc profile */
+ rc_decrement(thread_cdev->device_icc_profile,"clist_teardown_render_threads");
/* Free the device copy this thread used */
gs_free_object(thread->memory, thread_cdev, "clist_teardown_render_threads");
#ifdef DEBUG