mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8204947: Port ShenandoahTaskTerminator to mainline and make it default
Reviewed-by: tschatzl, rkennke
This commit is contained in:
parent
df4b7015bf
commit
b9769c732e
17 changed files with 418 additions and 52 deletions
|
@ -447,8 +447,8 @@ public:
|
|||
|
||||
#undef TRACESPINNING
|
||||
|
||||
class ParallelTaskTerminator: public StackObj {
|
||||
private:
|
||||
class ParallelTaskTerminator: public CHeapObj<mtGC> {
|
||||
protected:
|
||||
uint _n_threads;
|
||||
TaskQueueSetSuper* _queue_set;
|
||||
volatile uint _offered_termination;
|
||||
|
@ -481,7 +481,7 @@ public:
|
|||
// As above, but it also terminates if the should_exit_termination()
|
||||
// method of the terminator parameter returns true. If terminator is
|
||||
// NULL, then it is ignored.
|
||||
bool offer_termination(TerminatorTerminator* terminator);
|
||||
virtual bool offer_termination(TerminatorTerminator* terminator);
|
||||
|
||||
// Reset the terminator, so that it may be reused again.
|
||||
// The caller is responsible for ensuring that this is done
|
||||
|
@ -500,6 +500,38 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
// warning C4521: multiple copy constructors specified
|
||||
#pragma warning(disable:4521)
|
||||
// warning C4522: multiple assignment operators specified
|
||||
#pragma warning(disable:4522)
|
||||
#endif
|
||||
|
||||
class TaskTerminator : public StackObj {
|
||||
private:
|
||||
ParallelTaskTerminator* _terminator;
|
||||
|
||||
// Disable following copy constructors and assignment operator
|
||||
TaskTerminator(TaskTerminator& o) { }
|
||||
TaskTerminator(const TaskTerminator& o) { }
|
||||
TaskTerminator& operator=(TaskTerminator& o) { return *this; }
|
||||
public:
|
||||
TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set);
|
||||
~TaskTerminator();
|
||||
|
||||
// Move assignment
|
||||
TaskTerminator& operator=(const TaskTerminator& o);
|
||||
|
||||
ParallelTaskTerminator* terminator() const {
|
||||
return _terminator;
|
||||
}
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
|
||||
typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue