Subj : Re: distributed lock-free slab-allocator pseudo-code... To : comp.programming.threads From : Chris Thomasson Date : Sun Oct 02 2005 08:56 pm DOH! I posted wrong version, stupid cut & paste error!!! ;(.... The slab_sys_tls_dtor function needs to be changed from this > void slab_sys_tls_dtor( void *state ) > { > per_thread_t *_this = state; > int count = slab_sys_shared_pop( _this, 1 ); > > if ( XADD( &_this->refs, -count ) == 1 ) > { > /* destroy _this */ > } > } to this: void slab_sys_tls_dtor( void *state ) { per_thread_t *_this = state; int count = slab_sys_shared_pop( _this, 1 ) + 1; if ( XADD( &_this->refs, -count ) == 1 ) { /* destroy _this */ } } Sorry! :O .