From 59977b6c7cc81777dc6f8266c68945d1ab691aec Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 1 Mar 2011 10:10:25 +0000 Subject: GHC.Prim.threadStatus# now returns the cap number, and the value of TSO_LOCKED --- rts/PrimOps.cmm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'rts') diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 7a7942abcc..701654af49 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -631,7 +631,7 @@ stg_threadStatuszh W_ tso; W_ why_blocked; W_ what_next; - W_ ret; + W_ ret, cap, locked; tso = R1; @@ -651,7 +651,16 @@ stg_threadStatuszh ret = why_blocked; } } - RET_N(ret); + + cap = TO_W_(Capability_no(StgTSO_cap(tso))); + + if ((TO_W_(StgTSO_flags(tso)) & TSO_LOCKED) != 0) { + locked = 1; + } else { + locked = 0; + } + + RET_NNN(ret,cap,locked); } /* ----------------------------------------------------------------------------- -- cgit v1.2.1