File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
external-stg-interpreter/lib/Stg/Interpreter/PrimOp Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -345,22 +345,14 @@ retrySTM = unwindStack where
345345 ts <- getThreadState tid
346346 -- subscribe to wait queues
347347 let Just tlog = tsActiveTLog ts
348- case IntMap. null tlog of
349- True -> do
350- -- HINT: the transaction log is empty, so there is no TVar to subscribe, therefore the transaction is blocked indefinitely
351- updateThreadState tid (ts {tsActiveTLog = Nothing })
352- Rts {.. } <- gets ssRtsSupport
353- PrimConcurrency. raiseAsyncEx [] tid rtsBlockedIndefinitelyOnSTM
354- pure []
355- False -> do
356- subscribeTVarWaitQueues tid tlog
357- -- suspend thread
358- updateThreadState tid (ts {tsStatus = ThreadBlocked (BlockedOnSTM tlog), tsActiveTLog = Just mempty })
359- -- Q: who will update the tsTLog after the wake up?
360- stackPush $ Atomically stmAction
361- stackPush $ Apply [Void ]
362- stackPush $ RunScheduler SR_ThreadBlocked
363- pure [stmAction]
348+ subscribeTVarWaitQueues tid tlog -- HINT: GC deadlock detection will cover empty tlog and dead TVar caused deadlocks
349+ -- suspend thread
350+ updateThreadState tid (ts {tsStatus = ThreadBlocked (BlockedOnSTM tlog), tsActiveTLog = Just mempty })
351+ -- Q: who will update the tsTLog after the wake up?
352+ stackPush $ Atomically stmAction
353+ stackPush $ Apply [Void ]
354+ stackPush $ RunScheduler SR_ThreadBlocked
355+ pure [stmAction]
364356
365357 _ -> unwindStack -- HINT: discard stack frames
366358
You can’t perform that action at this time.
0 commit comments