library/src/threads/BP-LinuxThreads.cc
// Appends the thread list element "appendList" to the thread
// bearer element inList, attaching at the last element.  This
// function modifies the list values in appendList.  Copy them
// before calling this function if you intend to keep original values.
Appends the thread list element "appendList" to the thread
bearer element inList, attaching at the last element.  This
function modifies the list values in appendList.  Copy them
before calling this function if you intend to keep original values.
Appends the thread list element " appendList " to the thread bearer element inList attaching at the last element . This function modifies the list values in appendList . Copy them before calling this function if you intend to keep original values .
int AppendThreadToList(P_THREAD_LIST inList, P_THREAD_LIST appendList)
{
	if(inList == NULL)
		return ERR_FAILURE;
	if(appendList == NULL)
		return ERR_FAILURE;
	P_THREAD_LIST appendFirst = appendList->first;
	for(inList = inList->first; inList->next != NULL; inList = inList->next){}
	for(appendList = appendList->first; \
		appendList->next != NULL;\
		appendList = appendList->next){
		appendList->first = inList->first;	
	}
	if(appendList->next == NULL){
		if(appendList->first != inList->first)
			appendList->first = inList->first;
	}
	inList->next = appendFirst;
	appendFirst->prev = inList;
	return ERR_SUCCESS;
}
int AppendThreadToList ( P_THREAD_LIST inList , P_THREAD_LIST appendList ) { if ( inList == NULL ) return ERR_FAILURE ; if ( appendList == NULL ) return ERR_FAILURE ; P_THREAD_LIST appendFirst = appendList -> first ; for ( inList = inList -> first ; inList -> next != NULL ; inList = inList -> next ) { } for ( appendList = appendList -> first ; appendList -> next != NULL ; appendList = appendList -> next ) { appendList -> first = inList -> first ; } if ( appendList -> next == NULL ) { if ( appendList -> first != inList -> first ) appendList -> first = inList -> first ; } inList -> next = appendFirst ; appendFirst -> prev = inList ; return ERR_SUCCESS ; }
Appends the thread list element "appendList" to the thread
bearer element inList, attaching at the last element.
Appends the thread list element " appendList " to the thread bearer element inList attaching at the last element .
// get to the end of the list // now set all the append list first values to reflect inLists first pointer // now after all the pointers have been set, link up the chain