zoukankan      html  css  js  c++  java
  • 线程Join_yield

    package com.Thread;
     
    public class Jion_yield {
           public static void main(String[] args) throws Exception {
                Test tes = new Test();
                Thread t = new Thread(tes);
                t.start();
                
                 for(int i = 0; i<1000; i++) {
    //                if(i==200) {
                             //合并线程
    //                      t.join();
    //                }
                       if(i%20==0) {
                             //暂停本线程
                            Thread. yield();
                      }
                      System. out.println("main+++++" + i);
                }
          }
    }
    class Test implements Runnable{
           @Override
           public void run() {
                 for(int i=0; i<1000; i++) {
                      System. out.println("Test...." + i);
                }
          }
          
    }
  • 相关阅读:
    jQuery 事件注册
    jQuery 获取元素当前位置offset()与position()
    jquery scrollTop()与scrollLeft()
    linux常用命令
    php5.6+apache2.4环境配置
    php 开启socket配置
    Node.js的学习路线
    apache配置rewrite及.htaccess文件(转载)
    php 获取域名等Url
    html5的本地存储
  • 原文地址:https://www.cnblogs.com/king-/p/4389744.html
Copyright © 2011-2022 走看看