components/ghostscript/patches/12-7076729.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 512 a83040d1e4ec
child 7819 b1bca76ec901
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
512
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     1
--- ghostscript-9.00/base/gp_psync.c	Wed Jul 28 14:52:49 2010
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     2
+++ ghostscript-9.00/base/gp_psync.c	Fri Sep  9 12:12:13 2011
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     3
@@ -62,13 +62,18 @@
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     4
 {
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     5
     pt_semaphore_t * const sem = (pt_semaphore_t *)sema;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     6
     int scode;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     7
+    pthread_mutex_t tmp_mutex;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     8
+    pthread_cond_t tmp_cond;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
     9
 
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    10
     if (!sema)
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    11
 	return -1;		/* semaphores are not movable */
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    12
     sem->count = 0;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    13
-    scode = pthread_mutex_init(&sem->mutex, NULL);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    14
-    if (scode == 0)
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    15
-	scode = pthread_cond_init(&sem->cond, NULL);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    16
+    scode = pthread_mutex_init(&tmp_mutex, NULL);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    17
+    memcpy(&sem->mutex, &tmp_mutex, sizeof(pthread_mutex_t));
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    18
+    if (scode == 0) {
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    19
+	scode = pthread_cond_init(&tmp_cond, NULL);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    20
+	memcpy(&sem->cond, &tmp_cond, sizeof(pthread_cond_t));
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    21
+    }
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    22
     return SEM_ERROR_CODE(scode);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    23
 }
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    24
 
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    25
@@ -147,6 +152,7 @@
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    26
 gp_monitor_open(gp_monitor * mona)
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    27
 {
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    28
     pthread_mutex_t *mon;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    29
+    pthread_mutex_t  tmp_mutex;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    30
     int scode;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    31
 
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    32
     if (!mona)
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    33
@@ -153,7 +159,8 @@
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    34
 	return -1;		/* monitors are not movable */
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    35
     mon = &((gp_pthread_recursive_t *)mona)->mutex;
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    36
     ((gp_pthread_recursive_t *)mona)->self_id = 0;	/* Not valid unless mutex is locked */
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    37
-    scode = pthread_mutex_init(mon, NULL);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    38
+    scode = pthread_mutex_init(&tmp_mutex, NULL);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    39
+    memcpy(mon, &tmp_mutex, sizeof(pthread_mutex_t));
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    40
     return SEM_ERROR_CODE(scode);
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    41
 }
a83040d1e4ec 7076729 [cups] gs crashed and cups scheduler goes into maintenance
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
diff changeset
    42