package com.mandi.fendan.util; public class Runtest implements Runnable{ @Override public void run() { // System.err.println(Thread.currentThread().getName()); // synchronized (new Object()) { String str=DBchecksingleton.setDbc(Thread.currentThread().getName(), false); if(str.equals(Thread.currentThread().getName())){ System.err.println("A:::::"+str+"::::时间:::"+System.nanoTime()); String crd=DBchecksingleton.setDbc(Thread.currentThread().getName(), true); System.err.println(str+"B:::::"+crd+"::::时间:::"+System.nanoTime()); }else{ String rrr=DBchecksingleton.setDbc(Thread.currentThread().getName(), true); if(rrr==null){ System.err.println("C:::::"+Thread.currentThread().getName()+"::::时间:::"+System.nanoTime()); }else{ System.err.println(rrr+"::::D:::::"+Thread.currentThread().getName()+"::::时间:::"+System.nanoTime()); } // System.err.println("ddd:::::"+str); // System.err.println("fff:::::"+rrr); } // } //新建对象Lockerp放当å‰erpæ•°æ®åº“有没有修改æ“作 // lockerp是一个map key放入dbsign:放入Connection //所有的修改erpæ“作都事先需è¦åˆ¤æ–一下当å‰å€¼Lockerpèƒ½å¦æ‰¾åˆ° //放入Lockerp当剿“作erp的值 //è°ƒç”¨åŒæ¥çº¿ç¨‹Runerp:ä¸çŸ¥é“有多个请求的时候在线程åŽé¢æŽ’队的时间会ä¸ä¼šå¤ªé•¿ //åŒæ¥çº¿ç¨‹ä¼ 入傿•°Connection //如果Connectionç›¸ç‰ ä¼‘çœ //如果Connectionä¸ç›¸ç‰ 而且 //Runerpæ“作: //Runerp返回结果 } public static void main(String[] args){ Runtest t=new Runtest(); for (int i = 1; i < 110; i++) { new Thread(t,"name:"+i).start(); } } }