diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index ae277ec12f7a6b51566c6292aed443f9c7d90347..f1448f41701573ff458e67ce78a6c840550b0965 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1156,12 +1156,11 @@ stg_threadLabelzh ( gcptr tso ) stg_threadStatuszh ( gcptr tso ) { - W_ why_blocked; - W_ what_next; - W_ ret, cap, locked; + W_ why_blocked, what_next, flags, cap; + W_ ret, cap_no, locked; - what_next = TO_W_(StgTSO_what_next(tso)); - why_blocked = TO_W_(StgTSO_why_blocked(tso)); + what_next = TO_W_(RELAXED_LOAD_CLOSURE_FIELD(StgTSO_what_next, tso)); + why_blocked = TO_W_(RELAXED_LOAD_CLOSURE_FIELD(StgTSO_why_blocked, tso)); // Note: these two reads are not atomic, so they might end up // being inconsistent. It doesn't matter, since we // only return one or the other. If we wanted to return the @@ -1177,15 +1176,17 @@ stg_threadStatuszh ( gcptr tso ) } } - cap = TO_W_(Capability_no(StgTSO_cap(tso))); + cap = RELAXED_LOAD_CLOSURE_FIELD(StgTSO_cap, tso); + cap_no = TO_W_(Capability_no(cap)); - if ((TO_W_(StgTSO_flags(tso)) & TSO_LOCKED) != 0) { + flags = TO_W_(RELAXED_LOAD_CLOSURE_FIELD(StgTSO_flags, tso)); + if ((flags & TSO_LOCKED) != 0) { locked = 1; } else { locked = 0; } - return (ret,cap,locked); + return (ret,cap_no,locked); } /* -----------------------------------------------------------------------------