@@ -189,6 +189,7 @@ Type::Type(const Array& array) {
189
189
190
190
bool Type::isMulti () const {
191
191
if (id > _last_value_type) {
192
+ std::lock_guard<std::mutex> lock (mutex);
192
193
auto it = complexLookup.find (id);
193
194
if (it != complexLookup.end ()) {
194
195
return it->second .kind == TypeDef::TupleKind;
@@ -199,6 +200,7 @@ bool Type::isMulti() const {
199
200
200
201
bool Type::isRef () const {
201
202
if (id > _last_value_type) {
203
+ std::lock_guard<std::mutex> lock (mutex);
202
204
auto it = complexLookup.find (id);
203
205
if (it != complexLookup.end ()) {
204
206
switch (it->second .kind ) {
@@ -217,6 +219,7 @@ bool Type::isRef() const {
217
219
size_t Type::size () const { return expand ().size (); }
218
220
219
221
const Tuple& Type::expand () const {
222
+ std::lock_guard<std::mutex> lock (mutex);
220
223
auto it = complexLookup.find (id);
221
224
if (it != complexLookup.end ()) {
222
225
auto & typeDef = it->second ;
@@ -475,8 +478,9 @@ std::ostream& operator<<(std::ostream& os, Type type) {
475
478
break ;
476
479
default : {
477
480
assert (id > Type::_last_value_type);
481
+ std::lock_guard<std::mutex> lock (mutex);
478
482
auto it = complexLookup.find (id);
479
- if (it ! = complexLookup.end ()) {
483
+ if (it = = complexLookup.end ()) {
480
484
auto & typeDef = it->second ;
481
485
switch (typeDef.kind ) {
482
486
case TypeDef::TupleKind: {
0 commit comments