svn commit: r185483 - head/lib/libc/stdlib

Jason Evans jasone at FreeBSD.org
Sun Nov 30 11:30:32 PST 2008


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);
 		}
 	}


More information about the svn-src-all mailing list