Commit ceed3536 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Add even more threading asserts

parent 9407f64a
......@@ -192,8 +192,8 @@ private:
LOCK_REGION(&self->lock);
ASSERT(self->map.size() == self->map_elts, "%ld %d", self->map.size(), self->map_elts);
assert(s->my_tid == pthread_self());
ASSERT(self->map.size() == self->map_elts, "%ld %d", self->map.size(), self->map_elts);
assert(self->map.count(pthread_self()));
self->map.erase(pthread_self());
......@@ -202,6 +202,8 @@ private:
#endif
delete s;
ASSERT(self->map.size() == self->map_elts, "%ld %d", self->map.size(), self->map_elts);
}
template <int... S> Storage* make(impl::seq<S...>) {
......@@ -214,6 +216,7 @@ private:
protected:
void onFork() override {
ASSERT(this->map.size() == this->map_elts, "%ld %d", this->map.size(), this->map_elts);
pthread_t surviving_ptid = pthread_self();
for (auto it = this->map.begin(), end = this->map.end(); it != end;) {
if (it->first != surviving_ptid) {
......@@ -241,6 +244,8 @@ public:
for (auto& p : map) {
f(&p.second->val);
}
ASSERT(this->map.size() == this->map_elts, "%ld %d", this->map.size(), this->map_elts);
}
template <typename... Arguments> void forEachValue(std::function<void(T*, Arguments...)> f, Arguments... args) {
......@@ -250,6 +255,8 @@ public:
for (auto& p : map) {
f(&p.second->val, std::forward<Arguments>(args)...);
}
ASSERT(this->map.size() == this->map_elts, "%ld %d", this->map.size(), this->map_elts);
}
T* get() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment