From 91b057844624d1d64c0a0474fd31f18a9c1b0711 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 14 Mar 2013 16:34:56 +0100 Subject: [PATCH] foc: Select "thread-ready" bit in pause function --- base-foc/src/core/platform_thread.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base-foc/src/core/platform_thread.cc b/base-foc/src/core/platform_thread.cc index 5ca59200e..b84ac0c55 100644 --- a/base-foc/src/core/platform_thread.cc +++ b/base-foc/src/core/platform_thread.cc @@ -93,7 +93,11 @@ void Platform_thread::pause() */ l4_thread_ex_regs_ret(_thread.local.dst(), &_pager_obj->state.ip, &_pager_obj->state.sp, &flags); - bool in_syscall = flags == 0; + + /* + * The thread state ("ready") is encoded in the lowest bit of the flags. + */ + bool in_syscall = (flags & 1) == 0; _pager_obj->state.lock.unlock(); /**