예제 #1
0
void *_thread_start_local (void* arg) {
	//writeDebug("In _thread_start *************");
	struct Msg* msg = (struct Msg*) arg;
	//fprintf(stderr, "Message place is: %d\n", msg->placeTo);
	_thread_sethere(msg->placeTo);
	// dump_memory(1, msg->tb.addr, msg->tb.sz);
	task_create();
	method_t method = *((method_t*)(msg->tb.addr+sizeof(_task*)));
	void* params = (void*)(msg->tb.addr+sizeof(_task*)+sizeof(method_t));
	//writeDebug("passed this point32_t ************");
	//if(method == 31) fprintf(stderr, "CREATE ASYNC PASSGED BEFORE: %u\n", method);
	_thread_run_local(method, params);
  	//uint64_t value =  (((_task*) _thread_getspecific()) -> total_memory);
	//if(value != 0){
	//fprintf(stderr, "TOTAL MEMORY USED =%lu=\n", value);
	//}
	//if(method == 31) fprintf(stderr, "CREATE ASYNC PASSGED AFTER: %u\n", method);
	task_destroy();
	volatile _task* parent = *((_task**)msg->tb.addr);
	//fprintf(stderr, "THIS IS TASK START %x\n", parent);
	volatile place_t parent_place = msg->placeFrom;
	task_deregister_send((void*)parent, parent_place);
	//writeDebug("passed this point32_t ================");
	free(msg->tb.addr);
	_deallocate_msg_only(msg);
	if(!USE_THREAD_POOL){
	_thread_exit(NULL);
	}
}
예제 #2
0
FUNC_NORETURN void fiber_abort(void)
{
	/* Do normal thread exit cleanup, then give up CPU control */

	_thread_exit(_nanokernel.current);
	_nano_fiber_swap();
}
예제 #3
0
void fiber_delayed_start_cancel(void *handle)
{
	struct tcs *cancelled_tcs = (struct tcs *)handle;
	int key = irq_lock();

	_nano_timeout_abort(cancelled_tcs);
	_thread_exit(cancelled_tcs);

	irq_unlock(key);
}
예제 #4
0
void *_ack_thread_start (void* arg) {
	struct Msg* msg = (struct Msg*) arg;
	_task* parent = *((_task**)msg->tb.addr);
	_thread_sethere(msg->placeTo);
	task_deregister(parent);
	_deallocate_msg(msg);
	if(!USE_THREAD_POOL){
	_thread_exit(NULL);
	}
}