fix benchamrk JobSystem de-initialization

JobSystem's API requires to call emancipate() for each adopt() before
destroying the JobSystem.
This commit is contained in:
Mathias Agopian
2019-06-28 15:28:17 -07:00
committed by Mathias Agopian
parent 2a8f04c791
commit 31745f6025
2 changed files with 7 additions and 1 deletions

View File

@@ -38,6 +38,8 @@ static void BM_JobSystem(benchmark::State& state) {
}
}
state.SetItemsProcessed((int64_t)state.iterations());
js.emancipate();
}
static void BM_JobSystemAsChildren4k(benchmark::State& state) {
@@ -55,6 +57,8 @@ static void BM_JobSystemAsChildren4k(benchmark::State& state) {
}
}
state.SetItemsProcessed((int64_t)state.iterations() * 4096);
js.emancipate();
}
static void BM_JobSystemParallelFor(benchmark::State& state) {
@@ -70,6 +74,8 @@ static void BM_JobSystemParallelFor(benchmark::State& state) {
}
}
state.SetItemsProcessed((int64_t)state.iterations() * 4096);
js.emancipate();
}

View File

@@ -280,7 +280,7 @@ private:
// This should be a regular (non-atomic) pointer, but this causes TSAN to complain
// about a data-race that exists but is benin. We always use this atomic<> in
// relaxed mode.
// The data race TSAN complains about is when a pop() is interrupted buy a
// The data race TSAN complains about is when a pop() is interrupted by a
// pop() + push() just after mHead->next is read -- it appears as though it is written
// without synchronization (by the push), however in that case, the pop's CAS will fail
// and things will auto-correct.