From 1a94c3b623532333abee71caaa4feee1651861e3 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 29 Jun 2012 14:43:28 +0200 Subject: [PATCH] Fix: thread identifier comparator The invalid thread is specified as 0,0,-1 (ec cap, sc cap, sem cap). The main thread is specified as 0,0,0. The comparator identified "tid_main == tid_invalid" as equal, which is obviously wrong. The patch compares at least ec and sem cap. --- base-nova/include/base/native_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base-nova/include/base/native_types.h b/base-nova/include/base/native_types.h index 6c1528b289..89fdcd24af 100644 --- a/base-nova/include/base/native_types.h +++ b/base-nova/include/base/native_types.h @@ -31,8 +31,8 @@ namespace Genode { typedef Native_thread Native_thread_id; - inline bool operator == (Native_thread_id t1, Native_thread_id t2) { return t1.ec_sel == t2.ec_sel; } - inline bool operator != (Native_thread_id t1, Native_thread_id t2) { return t1.ec_sel != t2.ec_sel; } + inline bool operator == (Native_thread_id t1, Native_thread_id t2) { return (t1.ec_sel == t2.ec_sel) && (t1.sc_sel == t2.sc_sel) && (t1.rs_sel == t2.rs_sel); } + inline bool operator != (Native_thread_id t1, Native_thread_id t2) { return (t1.ec_sel != t2.ec_sel) && (t1.sc_sel != t2.sc_sel) && (t1.rs_sel != t2.rs_sel); } class Native_utcb {