org.jgroups.util.Util.interruptAndWaitToDie()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中org.jgroups.util.Util.interruptAndWaitToDie()方法的一些代码示例,展示了Util.interruptAndWaitToDie()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.interruptAndWaitToDie()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:interruptAndWaitToDie

Util.interruptAndWaitToDie介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

  1. public static boolean interruptAndWaitToDie(Thread t) {
  2. return interruptAndWaitToDie(t,Global.THREAD_SHUTDOWN_WAIT_TIME);
  3. }

代码示例来源:origin: wildfly/wildfly

  1. @Override
  2. public void destroy() {
  3. super.destroy();
  4. if (delayed_message_handler != null)
  5. Util.interruptAndWaitToDie(delayed_message_handler);
  6. }

代码示例来源:origin: wildfly/wildfly

  1. @Override
  2. public void stop() {
  3. if(running.compareAndSet(true, false)) {
  4. Util.close(srv_sock);
  5. Util.interruptAndWaitToDie(acceptor);
  6. super.stop();
  7. }
  8. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public void stop() {
  2. Thread tmp=t;
  3. if(t != null)
  4. t=null;
  5. if(tmp != null) {
  6. Util.interruptAndWaitToDie(tmp);
  7. }
  8. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public static boolean interruptAndWaitToDie(Thread t) {
  2. return interruptAndWaitToDie(t, Global.THREAD_SHUTDOWN_WAIT_TIME);
  3. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. public static boolean interruptAndWaitToDie(Thread t) {
  2. return interruptAndWaitToDie(t,Global.THREAD_SHUTDOWN_WAIT_TIME);
  3. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. void stop() {
  2. is_it_running=false;
  3. if(send_queue != null)
  4. send_queue.clear();
  5. if(senderThread != null) {
  6. Thread tmp=senderThread;
  7. senderThread=null;
  8. Util.interruptAndWaitToDie(tmp);
  9. }
  10. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. @Override
  2. public void destroy() {
  3. super.destroy();
  4. if (delayed_message_handler != null)
  5. Util.interruptAndWaitToDie(delayed_message_handler);
  6. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. @Override
  2. public void stop() {
  3. if(running.compareAndSet(true, false)) {
  4. Util.close(srv_sock);
  5. Util.interruptAndWaitToDie(acceptor);
  6. super.stop();
  7. }
  8. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. void destroy() {
  2. is_running=false;
  3. closeSocket(); // should terminate handler as well
  4. if(sender != null)
  5. sender.stop();
  6. Thread tmp=receiverThread;
  7. receiverThread=null;
  8. if(tmp != null) {
  9. Util.interruptAndWaitToDie(tmp);
  10. }
  11. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. /** Closes all open sockets, the server socket and all threads waiting for incoming messages */
  2. public void stop() {
  3. super.stop();
  4. // 1. Stop the reaper
  5. if(reaper != null)
  6. reaper.stop();
  7. // 2. close the server socket (this also stops the acceptor thread)
  8. if(srv_sock != null) {
  9. try {
  10. ServerSocket tmp=srv_sock;
  11. srv_sock=null;
  12. tmp.close();
  13. if(acceptor != null)
  14. Util.interruptAndWaitToDie(acceptor);
  15. }
  16. catch(Exception e) {
  17. }
  18. }
  19. // 3. then close the connections
  20. Collection<Connection> connsCopy=null;
  21. synchronized(conns) {
  22. connsCopy=new LinkedList<Connection>(conns.values());
  23. conns.clear();
  24. }
  25. for(Connection conn:connsCopy) {
  26. conn.destroy();
  27. }
  28. connsCopy.clear();
  29. local_addr=null;
  30. }

相关文章

Util类方法