线程调度:分时调度、抢占式调度(按照优先级)
要有线程对象,通过该对象才可以获取优先级。
下面是获取子线程的优先级;
MyThread thread=new MyThread();
System.out.println(thread.getPriority());
线程调度:分时调度、抢占式调度(按照优先级)
要有线程对象,通过该对象才可以获取优先级。
下面是获取子线程的优先级;
MyThread thread=new MyThread();
System.out.println(thread.getPriority());