Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2003 10:51:27 -0700 (PDT)
From:      Chris Vance <cvance@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 36048 for review
Message-ID:  <200308131751.h7DHpRem052791@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=36048

Change 36048 by cvance@cvance_osx_laptop on 2003/08/13 10:50:57

	wait_queue_t is a pointer, not a structure, so make sure it gets
	allocated before initialization.  The Mach wait_queue_alloc() function
	does both.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_condvar.c#4 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_condvar.c#4 (text+ko) ====

@@ -44,9 +44,9 @@
 {
 
 	bzero(cvp, sizeof(*cvp));
-	if (wait_queue_init(cvp->cv_wait_queue, SYNC_POLICY_FIFO) !=
-	    KERN_SUCCESS)
-		panic("cv_init: wait_queue_init failed");
+	cvp->cv_wait_queue = wait_queue_alloc(SYNC_POLICY_FIFO);
+	if (cvp->cv_wait_queue == WAIT_QUEUE_NULL)
+		panic("cv_init: wait_queue_alloc failed");
 }
 
 void
@@ -61,6 +61,7 @@
 	if (!wait_queue_is_queue(cvp->cv_wait_queue))
 		panic("cv_destroy: !wait_queue_is_queue");
 #endif
+	wait_queue_free(cvp->cv_wait_queue);
 	bzero(cvp, sizeof(*cvp));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308131751.h7DHpRem052791>