library/src/blockclass/BP-BlockClass.cc
// destroys the thread at the position threadNumber
destroys the thread at the position threadNumber
destroys the thread at the position threadNumber
int Block::DestroyThread(int threadNumber)
{
	int i = 0;
	P_THREAD_LIST threadFirst = NULL;
	if (threadNumber < 0 || threads == NULL)
		return ERR_FAILURE;
	threadFirst = threads->first;
	for (threads = threads->first; threads != NULL; threads = threads->next)
	{
		if (i == threadNumber)
			break;
		i++;
	}
	if (threads == NULL)
	{
		threads = threadFirst;
		return ERR_FAILURE;
	}
	FreeThreadElement(threads);
	return ERR_SUCCESS;
}
int Block :: DestroyThread ( int threadNumber ) { int i = 0 ; P_THREAD_LIST threadFirst = NULL ; if ( threadNumber < 0 || threads == NULL ) return ERR_FAILURE ; threadFirst = threads -> first ; for ( threads = threads -> first ; threads != NULL ; threads = threads -> next ) { if ( i == threadNumber ) break ; i ++ ; } if ( threads == NULL ) { threads = threadFirst ; return ERR_FAILURE ; } FreeThreadElement ( threads ) ; return ERR_SUCCESS ; }
destroys the thread at the position threadNumber
destroys the thread at the position threadNumber
// save the first pointer // destroy the individual thread element // return indicating success