#include <sys/threads.h>
#include <stdlib.h>
void thread_sleep_irq(THREAD* thread)
{
if (thread == NULL)
thread = current_thread();
thread->wait = 1;
schedule_thread( thread );
};