library/src/threads/BP-LinuxThreads.cc
// destroys one thread list element.  Automatically
// patches list if prev or next exist.  Does not destroy allocated
// shared data.
destroys one thread list element.  Automatically
patches list if prev or next exist.  Does not destroy allocated
shared data.
destroys one thread list element . Automatically patches list if prev or next exist . Does not destroy allocated shared data .
int FreeThreadElement(P_THREAD_LIST inList){
	if(inList == NULL)
		return ERR_FAILURE;
	P_THREAD_LIST prev = NULL;
	P_THREAD_LIST next = NULL;
	if(inList->prev != NULL)
		prev = inList->prev;
	if(inList->next != NULL)
		next = inList->next;
	if(prev != NULL)
		prev->next = next;
	if(inList->threadDescription != NULL)
		bpfree(inList->threadDescription); 
	memset(inList, 0x00, sizeof(THREAD_LIST));
	bpfree(inList);
	return ERR_SUCCESS;
}
int FreeThreadElement ( P_THREAD_LIST inList ) { if ( inList == NULL ) return ERR_FAILURE ; P_THREAD_LIST prev = NULL ; P_THREAD_LIST next = NULL ; if ( inList -> prev != NULL ) prev = inList -> prev ; if ( inList -> next != NULL ) next = inList -> next ; if ( prev != NULL ) prev -> next = next ; if ( inList -> threadDescription != NULL ) bpfree ( inList -> threadDescription ) ; memset ( inList , 0x00 , sizeof ( THREAD_LIST ) ) ; bpfree ( inList ) ; return ERR_SUCCESS ; }
destroys one thread list element.
destroys one thread list element .
// initialize prev/next ptrs for list manipulation // check prev/next pointers // relink the chain before bpfreeing // bpfree objects //if(inList->sharedData != NULL) //	bpfree(inList->sharedData);