1348 private: 1349 // Support for thread handshake operations 1350 HandshakeState _handshake; 1351 public: 1352 void set_handshake_operation(HandshakeOperation* op) { 1353 _handshake.set_operation(op); 1354 } 1355 1356 bool has_handshake() const { 1357 return _handshake.has_operation(); 1358 } 1359 1360 void handshake_process_by_self() { 1361 _handshake.process_by_self(); 1362 } 1363 1364 HandshakeState::ProcessResult handshake_try_process(HandshakeOperation* op) { 1365 return _handshake.try_process(op); 1366 } 1367 1368 #ifdef ASSERT 1369 Thread* active_handshaker() const { 1370 return _handshake.active_handshaker(); 1371 } 1372 #endif 1373 1374 // Suspend/resume support for JavaThread 1375 private: 1376 inline void set_ext_suspended(); 1377 inline void clear_ext_suspended(); 1378 1379 public: 1380 void java_suspend(); // higher-level suspension logic called by the public APIs 1381 void java_resume(); // higher-level resume logic called by the public APIs 1382 int java_suspend_self(); // low-level self-suspension mechanics 1383 1384 private: 1385 // mid-level wrapper around java_suspend_self to set up correct state and 1386 // check for a pending safepoint at the end 1387 void java_suspend_self_with_safepoint_check(); 1388 1389 public: 1390 void check_and_wait_while_suspended() { 1391 assert(JavaThread::current() == this, "sanity check"); 1392 | 1348 private: 1349 // Support for thread handshake operations 1350 HandshakeState _handshake; 1351 public: 1352 void set_handshake_operation(HandshakeOperation* op) { 1353 _handshake.set_operation(op); 1354 } 1355 1356 bool has_handshake() const { 1357 return _handshake.has_operation(); 1358 } 1359 1360 void handshake_process_by_self() { 1361 _handshake.process_by_self(); 1362 } 1363 1364 HandshakeState::ProcessResult handshake_try_process(HandshakeOperation* op) { 1365 return _handshake.try_process(op); 1366 } 1367 1368 Thread* active_handshaker() const { 1369 return _handshake.active_handshaker(); 1370 } 1371 1372 // Suspend/resume support for JavaThread 1373 private: 1374 inline void set_ext_suspended(); 1375 inline void clear_ext_suspended(); 1376 1377 public: 1378 void java_suspend(); // higher-level suspension logic called by the public APIs 1379 void java_resume(); // higher-level resume logic called by the public APIs 1380 int java_suspend_self(); // low-level self-suspension mechanics 1381 1382 private: 1383 // mid-level wrapper around java_suspend_self to set up correct state and 1384 // check for a pending safepoint at the end 1385 void java_suspend_self_with_safepoint_check(); 1386 1387 public: 1388 void check_and_wait_while_suspended() { 1389 assert(JavaThread::current() == this, "sanity check"); 1390 |