8209850: Allow NamedThreads to use GlobalCounter critical sections

Add NamedThreads iterator and make GlobalCounter use it.

Reviewed-by: eosterlund, rehn
This commit is contained in:
Kim Barrett 2018-08-23 18:14:53 -04:00
parent 8b138c684a
commit 23f0fb4cde
11 changed files with 458 additions and 69 deletions

View file

@ -29,6 +29,7 @@
#include "oops/oop.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include "utilities/singleWriterSynchronizer.hpp"
class Mutex;
class outputStream;
@ -203,19 +204,6 @@ NOT_AIX( private: )
void unlink(const Block& block);
};
// RCU-inspired protection of access to _active_array.
class ProtectActive {
volatile uint _enter;
volatile uint _exit[2];
public:
ProtectActive();
uint read_enter();
void read_exit(uint enter_value);
void write_synchronize();
};
private:
const char* _name;
ActiveArray* _active_array;
@ -229,7 +217,7 @@ private:
volatile size_t _allocation_count;
// Protection for _active_array.
mutable ProtectActive _protect_active;
mutable SingleWriterSynchronizer _protect_active;
// mutable because this gets set even for const iteration.
mutable bool _concurrent_iteration_active;