Commit 1f0fbfc
committed
Fix debug flush race from open-simh PR 454
Fix the debug-output flush race described in open-simh/simh#454, but
with a much simpler local implementation.
The old debug flush path drained SIMH's internal debug buffer, then
closed and reopened ordinary debug files to force the stdio buffers out.
That temporarily cleared and replaced the global debug stream, which
could race with other threads emitting debug output.
Keep the internal debug-buffer flush, then call fflush() on the current
debug stream. This preserves the useful flush behavior without closing
or replacing sim_deb.
Upstream-PR: open-simh/simh#4541 parent 0a57aee commit 1f0fbfc
1 file changed
Lines changed: 6 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10388 | 10388 | | |
10389 | 10389 | | |
10390 | 10390 | | |
| 10391 | + | |
10391 | 10392 | | |
10392 | 10393 | | |
10393 | | - | |
10394 | | - | |
10395 | | - | |
10396 | | - | |
10397 | | - | |
| 10394 | + | |
| 10395 | + | |
10398 | 10396 | | |
10399 | | - | |
10400 | | - | |
| 10397 | + | |
10401 | 10398 | | |
10402 | | - | |
| 10399 | + | |
| 10400 | + | |
10403 | 10401 | | |
10404 | | - | |
10405 | | - | |
10406 | 10402 | | |
10407 | | - | |
10408 | | - | |
10409 | | - | |
10410 | | - | |
10411 | | - | |
10412 | | - | |
10413 | | - | |
10414 | | - | |
10415 | | - | |
10416 | | - | |
10417 | | - | |
10418 | | - | |
10419 | | - | |
10420 | | - | |
10421 | 10403 | | |
10422 | 10404 | | |
10423 | 10405 | | |
| |||
0 commit comments