Skip to content

Commit a357a12

Browse files
committed
Make static members of dynamic_modint thread_local
1 parent 7ffac19 commit a357a12

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cp-algo/number_theory/modint.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ namespace cp_algo::math {
158158
return callback();
159159
}
160160
private:
161-
static Int m;
162-
static Base::UInt im, r1, r2;
161+
static thread_local Int m;
162+
static thread_local Base::UInt im, r1, r2;
163163
};
164164
template<typename Int>
165-
Int dynamic_modint<Int>::m = 1;
165+
Int thread_local dynamic_modint<Int>::m = 1;
166166
template<typename Int>
167-
dynamic_modint<Int>::Base::UInt dynamic_modint<Int>::im = -1;
167+
dynamic_modint<Int>::Base::UInt thread_local dynamic_modint<Int>::im = -1;
168168
template<typename Int>
169-
dynamic_modint<Int>::Base::UInt dynamic_modint<Int>::r2 = 0;
169+
dynamic_modint<Int>::Base::UInt thread_local dynamic_modint<Int>::r2 = 0;
170170
}
171171
#endif // CP_ALGO_MATH_MODINT_HPP

0 commit comments

Comments
 (0)