zoukankan      html  css  js  c++  java
  • 线程工具类ThreadUtils

    package yqw.java.util;

    public class ThreadUtils {

        /**
         * showThreadInfo
         *
         * @return
         */
        public static final String showThreadInfo() {

            return "^^^^^^^^^^^^^^^^^^^^^^^ currentThread: name=" + Thread.currentThread().getName() + "  , id="
                    + Thread.currentThread().getId() +

            "   ,state=" + Thread.currentThread().getState() + "   , Priority=" + Thread.currentThread().getPriority();
        }

        /**
         * sleep not catch Exception
         *
         * @param ms
         * @return
         */
        public static boolean sleep(int ms) {
            try {
                Thread.sleep(ms);
                return true;
            } catch (InterruptedException e) {
                return false;
            }
        }
    }

  • 相关阅读:
    权限和分组
    验证与授权
    CSRF、XSS、clickjacking、SQL 的攻击与防御
    上下文处理器及中间件
    类和实例
    偏函数
    生成器
    迭代 复习
    函数调用 复习
    复习 条件判断,循环
  • 原文地址:https://www.cnblogs.com/yang75n/p/8412963.html
Copyright © 2011-2022 走看看