From 17daa728ae3a8f300d12dcd5b130b18a96fb15d6 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Sun, 30 Nov 2008 19:30:31 +0000 Subject: [PATCH] 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 --- lib/libc/stdlib/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 4b37e721aec1..8004d5199ff6 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -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); } }