summaryrefslogtreecommitdiff
path: root/core/host
diff options
context:
space:
mode:
Diffstat (limited to 'core/host')
-rw-r--r--core/host/task.c3
-rw-r--r--core/host/timer.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/core/host/task.c b/core/host/task.c
index 7a17e13e89..500e18413d 100644
--- a/core/host/task.c
+++ b/core/host/task.c
@@ -54,7 +54,8 @@ static int generator_sleeping;
static timestamp_t generator_sleep_deadline;
static int has_interrupt_generator = 1;
-static __thread task_id_t my_task_id; /* thread local task id */
+/* thread local task id */
+static __thread task_id_t my_task_id = TASK_ID_INVALID;
static void task_enable_all_tasks_callback(void);
diff --git a/core/host/timer.c b/core/host/timer.c
index 1c1fe01457..b29786b007 100644
--- a/core/host/timer.c
+++ b/core/host/timer.c
@@ -39,7 +39,7 @@ static int time_set;
void usleep(unsigned us)
{
- if (!task_start_called()) {
+ if (!task_start_called() || task_get_current() == TASK_ID_INVALID) {
udelay(us);
return;
}