Right now gtests that uses threads requires a lot of ceremony: Subclassing JavaTestThread, adding private members and constructors for state and passing in pointers to shared state. It's even worse when running many threads: allocating thread arrays, for-looping to populate the array, and so on.
A thread is "just" a function and some initial state, so we can remove most of this ceremony by introducing a couple of small utilities.
Finally, this change ports SymbolTable test_symbol_refcount_parallel and GlobalCounter critical_section to use the new tools.
A thread is "just" a function and some initial state, so we can remove most of this ceremony by introducing a couple of small utilities.
Finally, this change ports SymbolTable test_symbol_refcount_parallel and GlobalCounter critical_section to use the new tools.