Skip to content

Commit

Permalink
[GC] minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
schveiguy committed Nov 26, 2024
1 parent 583a5a7 commit 8395039
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions sdlib/d/gc/collector.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ private:
* We might have allocated, and therefore refilled the bin
* during the collection process. As a result, slots in the
* bins may not be marked at this point.
*
*
* The straightforward way to handle this is simply to flush
* the bins.
*
*
* Alternatively, we could make sure the slots are marked.
*/
threadCache.flush();
Expand All @@ -76,7 +76,7 @@ private:

collect(gcCycle);

// allow threads to do busyState things.
// Probation period is over, threads can enter busy state now.
clearWorldProbation();
}

Expand Down
7 changes: 4 additions & 3 deletions sdlib/d/gc/tstate.d
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public:
return;
}

// In Resumed state, we need to wait until the GC cycle is done before doing anything.
// In Probation state, we need to wait until the GC cycle is
// done before doing anything.
busyWaitMutex.lock();
scope(exit) busyWaitMutex.unlock();
busyWaitMutex.waitFor(offProbation);
Expand Down Expand Up @@ -356,7 +357,7 @@ unittest suspend {
assert(s.onSuspendSignal());
check(SuspendState.Probation, false, 1);

// Clear the probation
// Clear the probation.
s.clearProbationState();
check(SuspendState.None, false, 1);

Expand All @@ -377,7 +378,7 @@ unittest suspend {
assert(s.exitBusyState());
check(SuspendState.Probation, false, 2);

// Enter busy state while on probation
// Enter busy state while on probation.
assert(lockedProbationCount.load() == 0);
s.enterBusyState();
assert(lockedProbationCount.load() == 1);
Expand Down
1 change: 0 additions & 1 deletion test/valid/test0203.d
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void* watchdog(void* ctx) {
threadCache.state.state.store(SuspendState.Detached);
int i;
while (!shouldQuit.load()) {
// Watchdog timeout!
assert(++i < 15, "Watchdog timeout!");
sleep(1);
}
Expand Down

0 comments on commit 8395039

Please sign in to comment.