55
56 Semaphore _semaphore;
57 bool _thread_in_process_handshake;
58
59 bool claim_handshake_for_vmthread();
60 bool vmthread_can_process_handshake(JavaThread* target);
61
62 void clear_handshake(JavaThread* thread);
63 void cancel_inner(JavaThread* thread);
64
65 void process_self_inner(JavaThread* thread);
66 public:
67 HandshakeState();
68
69 void set_operation(JavaThread* thread, HandshakeOperation* op);
70
71 bool has_operation() const {
72 return _operation != NULL;
73 }
74
75 void cancel(JavaThread* thread) {
76 if (!_thread_in_process_handshake) {
77 FlagSetting fs(_thread_in_process_handshake, true);
78 cancel_inner(thread);
79 }
80 }
81
82 void process_by_self(JavaThread* thread) {
83 if (!_thread_in_process_handshake) {
84 FlagSetting fs(_thread_in_process_handshake, true);
85 process_self_inner(thread);
86 }
87 }
88 void process_by_vmthread(JavaThread* target);
89 };
90
91 #endif // SHARE_VM_RUNTIME_HANDSHAKE_HPP
|
55
56 Semaphore _semaphore;
57 bool _thread_in_process_handshake;
58
59 bool claim_handshake_for_vmthread();
60 bool vmthread_can_process_handshake(JavaThread* target);
61
62 void clear_handshake(JavaThread* thread);
63 void cancel_inner(JavaThread* thread);
64
65 void process_self_inner(JavaThread* thread);
66 public:
67 HandshakeState();
68
69 void set_operation(JavaThread* thread, HandshakeOperation* op);
70
71 bool has_operation() const {
72 return _operation != NULL;
73 }
74
75 void process_by_self(JavaThread* thread) {
76 if (!_thread_in_process_handshake) {
77 FlagSetting fs(_thread_in_process_handshake, true);
78 process_self_inner(thread);
79 }
80 }
81
82 void process_by_vmthread(JavaThread* target);
83 };
84
85 #endif // SHARE_VM_RUNTIME_HANDSHAKE_HPP
|