1 Commits
+2 -3
View File
@@ -113,9 +113,8 @@ void GC::Start() {
this->thrd = new Thread([this]() -> void { this->thrd = new Thread([this]() -> void {
while (this->IsRunning()) { while (this->IsRunning()) {
this->BarrierBegin(); this->BarrierBegin();
while (this->allocs < ALLOC_THRESHOLD) while (this->IsRunning() && (this->allocs < ALLOC_THRESHOLD))
this->cond.Wait( this->cond.Wait(&this->mtx);
&this->mtx); // your wrapper around pthread_cond_wait
this->allocs = 0; this->allocs = 0;
std::vector<THeapObject *> to_delete; std::vector<THeapObject *> to_delete;
this->Collect(to_delete); this->Collect(to_delete);