rem: while(i<1024 && _lwp_ids[i]!=-1) i++;
add: while(i<1024 && _lwp_threads[i]!=-1) i++;
context: u32 __lwp_thread_init(lwp_cntrl *thethread,void *stack_area,u32 stack_size,u32 prio,u32 isr_level){	u32 i,act_stack_size = 0;#ifdef _LWPTHREADS_DEBUG	printf("__lwp_thread_init(%p,%p,%d,%d,%d)\n",thethread,stack_area,stack_size,prio,isr_level);#endif	if(!stack_area) {		if(!__lwp_stack_isenough(stack_size))			act_stack_size = CPU_MINIMUM_STACK_SIZE;		else			act_stack_size = stack_size;		act_stack_size = __lwp_stack_allocate(thethread,act_stack_size);		if(!act_stack_size) return 0;		thethread->stack_allocated = TRUE;	} else {		thethread->stack = stack_area;		act_stack_size = stack_size;		thethread->stack_allocated = FALSE;	}	thethread->stack_size = act_stack_size;	i=0;	while(i<1024 && _lwp_ids[i]!=-1) i++;	if(i<1024) {		_lwp_ids[i] = (u32)thethread;		thethread->id = i+1;	} else		thethread->id = -1;	memset(&thethread->context,0,sizeof(thethread->context));	memset(&thethread->fp,0,sizeof(thethread->fp));	memset(&thethread->wait,0,sizeof(thethread->wait));	__lwp_threadqueue_init(&thethread->wait.join,LWP_THREADQ_MODEFIFO,LWP_STATES_WAITING_FOR_JOINATEXIT,0);		thethread->isr_level = isr_level;	thethread->real_prio = prio;	thethread->cur_state = LWP_STATES_DORMANT;	thethread->suspendcnt = 0;	thethread->res_cnt = 0;	__lwp_thread_setpriority(thethread,prio);	__libc_create_hook(_thr_executing,thethread);	return 1;}