提交 fcdc328f 编写于 作者: S sbohne

6666698: EnableBiasedLocking with BiasedLockingStartupDelay can block Watcher thread

Summary: Enqueue VM_EnableBiasedLocking operation asynchronously
Reviewed-by: never, xlu, kbr, acorn
上级 73649444
...@@ -40,6 +40,9 @@ class VM_EnableBiasedLocking: public VM_Operation { ...@@ -40,6 +40,9 @@ class VM_EnableBiasedLocking: public VM_Operation {
public: public:
VM_EnableBiasedLocking() {} VM_EnableBiasedLocking() {}
VMOp_Type type() const { return VMOp_EnableBiasedLocking; } VMOp_Type type() const { return VMOp_EnableBiasedLocking; }
Mode evaluation_mode() const { return _async_safepoint; }
bool is_cheap_allocated() const { return true; }
void doit() { void doit() {
// Iterate the system dictionary enabling biased locking for all // Iterate the system dictionary enabling biased locking for all
// currently loaded classes // currently loaded classes
...@@ -62,8 +65,10 @@ class EnableBiasedLockingTask : public PeriodicTask { ...@@ -62,8 +65,10 @@ class EnableBiasedLockingTask : public PeriodicTask {
EnableBiasedLockingTask(size_t interval_time) : PeriodicTask(interval_time) {} EnableBiasedLockingTask(size_t interval_time) : PeriodicTask(interval_time) {}
virtual void task() { virtual void task() {
VM_EnableBiasedLocking op; // Use async VM operation to avoid blocking the Watcher thread.
VMThread::execute(&op); // VM Thread will free C heap storage.
VM_EnableBiasedLocking *op = new VM_EnableBiasedLocking();
VMThread::execute(op);
// Reclaim our storage and disenroll ourself // Reclaim our storage and disenroll ourself
delete this; delete this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册