PR_ASSERT( PR_SetThreadPrivate( (PRUint8) 0, (void *) NULL ) == PR_SUCCESS );
result = PR_SetThreadPrivate( (PRUint8) 0, (void *) NULL ); PR_ASSERT( result == PR_SUCCESS );
_bt_root (void* arg){    PRThread *thred = (PRThread*)arg;    PRIntn rv;    void *privData;    status_t result;    int i;    struct _BT_PrivateHash *hashTable;    /* Set within the current thread the pointer to our object. This       object will be deleted when the thread termintates.  */    PR_ASSERT( PR_SetThreadPrivate( 0, (void *) thred ) == PR_SUCCESS );    thred->startFunc(thred->arg);  /* run the dang thing */    /*    ** Call the destructor, if available.    */    PR_Lock( bt_privateRoot.lock );    for( i = 0; i < 128; i++ )    {	hashTable = bt_privateRoot.keys[i];	if( hashTable != NULL )	{	    if( hashTable->destructor != NULL )	    {		privData = _bt_getThreadPrivate( i );		if( privData != NULL )		{		    PR_Unlock( bt_privateRoot.lock );		    hashTable->destructor( privData );		    PR_Lock( bt_privateRoot.lock );		}	    }	}    }    PR_Unlock( bt_privateRoot.lock );    /* decrement our thread counters */    PR_Lock( bt_book.ml );    if (thred->state & BT_THREAD_SYSTEM) {#if 0        bt_book.system -= 1;#endif    } else     {	bt_book.threadCount--;	if( 0 == bt_book.threadCount )	{            PR_NotifyAllCondVar(bt_book.cv);	}    }    PR_Unlock( bt_book.ml );    if( thred->md.is_joinable == 1 )    {	/*	** This is a joinable thread.  Keep suspending	** until is_joining is set to 1	*/	if( thred->md.is_joining == 0 )	{	    suspend_thread( thred->md.tid );	}    }    /* delete the thread object */    PR_DELETE(thred);    PR_ASSERT( PR_SetThreadPrivate( (PRUint8) 0, (void *) NULL ) == PR_SUCCESS );    exit_thread( NULL );}