nmalloc - Fix depot race - this should fix remaining issues with firefox.
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Oct 2010 19:21:32 +0000 (12:21 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Oct 2010 19:21:32 +0000 (12:21 -0700)
commitebe0d3612773443a8bf0158503b9597cf70acd03
tree97738c1d1ab66289653012a3a668fab934005fe8
parent0111d7ffeb6c6994f742e876e28854745d4a13e8
nmalloc - Fix depot race - this should fix remaining issues with firefox.

* nmalloc was accidently calling the libc _pthread_spin_lock() stub
  even when threaded, causing all depot operations to race.  No actual
  lock was being acquired.

  Change it over to the internal _SPINLOCK() API.

* Expand libthread_xu's base spinlocks from 128 to 256 and use those
  for the depot lock.  Note that the depot[] array can be upwards of
  80 elements so lets not take any chances.

Reported-by: Pierre Abbat <phma@phma.optus.nu>, others
lib/libc/stdlib/nmalloc.c
lib/libthread_xu/thread/thr_spinlock.c