+retry:
+ p = StgInd_indirectee(R1);
+ if (GETTAG(p) != 0) {
+ R1 = p;
+ jump %ENTRY_CODE(Sp(0));
+ }
+
+ info = StgHeader_info(p);
+ if (info == stg_IND_info) {
+ // This could happen, if e.g. we got a BLOCKING_QUEUE that has
+ // just been replaced with an IND by another thread in
+ // wakeBlockingQueue().
+ goto retry;
+ }
+
+ if (info == stg_TSO_info ||
+ info == stg_BLOCKING_QUEUE_CLEAN_info ||
+ info == stg_BLOCKING_QUEUE_DIRTY_info)
+ {
+ ("ptr" msg) = foreign "C" allocate(MyCapability() "ptr",
+ BYTES_TO_WDS(SIZEOF_MessageBlackHole)) [R1];
+
+ SET_HDR(msg, stg_MSG_BLACKHOLE_info, CCS_SYSTEM);
+ MessageBlackHole_tso(msg) = CurrentTSO;
+ MessageBlackHole_bh(msg) = R1;
+
+ (r) = foreign "C" messageBlackHole(MyCapability() "ptr", msg "ptr") [R1];
+
+ if (r == 0) {
+ goto retry;
+ } else {
+ StgTSO_why_blocked(CurrentTSO) = BlockedOnBlackHole::I16;
+ StgTSO_block_info(CurrentTSO) = msg;
+ jump stg_block_blackhole;
+ }
+ }
+ else
+ {
+ R1 = p;
+ ENTER();
+ }