Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Nov 2008 19:30:31 +0000 (UTC)
From:      Jason Evans <jasone@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185483 - head/lib/libc/stdlib
Message-ID:  <200811301930.mAUJUVRo099583@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jasone
Date: Sun Nov 30 19:30:31 2008
New Revision: 185483
URL: http://svn.freebsd.org/changeset/base/185483

Log:
  Adjust an assertion to handle the case where a lock is contested, but
  spinning is avoided due to running on a single-CPU system.
  
  Reported by:	stefanf

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==============================================================================
--- head/lib/libc/stdlib/malloc.c	Sun Nov 30 19:06:35 2008	(r185482)
+++ head/lib/libc/stdlib/malloc.c	Sun Nov 30 19:30:31 2008	(r185483)
@@ -1284,7 +1284,7 @@ malloc_spin_lock(pthread_mutex_t *lock)
 			 * inversion.
 			 */
 			_pthread_mutex_lock(lock);
-			assert((ret << BLOCK_COST_2POW) != 0);
+			assert((ret << BLOCK_COST_2POW) != 0 || ncpus == 1);
 			return (ret << BLOCK_COST_2POW);
 		}
 	}



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