- 浏览: 1256312 次
- 性别:
- 来自: 常州
文章分类
- 全部博客 (499)
- java (101)
- linux (82)
- mysql (30)
- javascript (45)
- Oracle (12)
- ext (14)
- 虚拟机 (1)
- 搜索引擎 (2)
- struts2 (11)
- 设计模式 (9)
- nginx (17)
- tomcat (12)
- 随想 (10)
- spring (18)
- svn (1)
- flash (3)
- UML (1)
- 数据结构 (7)
- 算法 (2)
- 网摘 (9)
- 数据库 (15)
- ibatis (3)
- jquery (31)
- lucene (1)
- hibernate (14)
- Myeclipse (4)
- 线程 (7)
- jbpm (4)
- 重构 (1)
- mantis (3)
- MediaWiki (4)
- ExtMail (1)
- MDaemon (1)
- egit (1)
- dwr (7)
- sitemesh (2)
- mybatis (1)
- ico (1)
- hadoop (5)
- jsoup (1)
- urlrewrite (2)
- jstl (1)
- spring3 (2)
- aop (2)
- 定时器 (1)
- Quartz (2)
- apache (1)
- php (1)
- security (1)
- iptables (2)
- QQ (1)
- mysqldump (1)
- vim (1)
- memcached (4)
- jad (1)
- 微博 (1)
- html5 (1)
- css3 (1)
- httpclient (10)
- google (1)
- shortUrl (1)
- json (2)
- virtualBox (1)
- mantisBT (2)
- htmlunit (1)
- selenium (2)
- mail (1)
- 正则表达式 (4)
- html (3)
- css (2)
- jatoolsPrinter (1)
- 图片处理 (1)
- hql (1)
- webservice (1)
- 分词 (3)
- 短信 (1)
- VPS (1)
- 事务 (1)
- 广告 (1)
- 画廊 (1)
- git (3)
- github (1)
- openshift (1)
- 缓存 (1)
- web (3)
- android (3)
- c3p0 (1)
- 邮箱 (1)
- memcache (2)
- windows (2)
- js (14)
- 编辑器 (1)
- 打印 (1)
- centos (5)
- boneCP (1)
- 连接池 (1)
- sql (1)
- nosql (1)
- MongoDB (1)
- 浏览器 (1)
- node (1)
- node.js (1)
- backbone.js (1)
- lazyload (1)
- Switch Off (1)
- Titanium (1)
- 网站架构 (1)
- WebDriver (1)
- APJP (1)
- 代理 (1)
- comet (1)
- kendoui (1)
- UI (2)
- 互联网 (1)
- localStorage (1)
- 记录 (1)
- 微信 (2)
- Sphinx (1)
- netty (1)
- js,mvvm,Avalon (1)
- 安卓 (1)
- Tengine (1)
- 大数据 (1)
- 手机 (1)
- paypal (1)
- SaaS (1)
- gitlab (1)
- nodejs (1)
- React (1)
- shadowsocks (0)
- vpn (0)
- 验证码 (1)
- SSL (2)
- SEO (1)
- IntelliJ (1)
- 敏捷开发 (1)
- 项目管理 (1)
- 爬虫 (1)
- 正则 (1)
- owncloud (1)
- 云存储 (1)
- ajax (1)
- pjax (1)
- jdk (1)
- zookeeper (1)
- phantomjs (1)
- ELK (1)
- springcloud (1)
- IDEA (1)
- hexo (1)
- ss (1)
- letencrypt (1)
最新评论
-
peakandyuri:
这个是有BUG的,数字小体现不出来,数字大了就不对了,但是Ja ...
java十进制转换N进制并反转换的工具类 -
ginolai:
然后是相关配置:/etc/sysconfig/iptables ...
Linux中iptables设置详细 -
bzhao:
我测试没啥区别啊!
Thread.sleep()和Thread.currentThread().sleep()区别 -
zhl549342097:
match == false
Spring Security 3.1 中功能强大的加密工具 PasswordEncoder -
hellotieye:
renzhengzhi 写道drager 写道用jsoup后解 ...
jsoup select 选择器
线程可以用继承Thread类或者实现Runnable接口来实现.
Thread.sleep()是Thread类的方法,只对当前线程起作用,睡眠一段时间.
如果线程是通过继承Thread实现的话这2个方法没有区别;
如果线程是通过实现Runnable接口来实现的,则不是Thread类,不能直接使用Thread.sleep()
必须使用Thread.currentThread()来得到当前线程的引用才可以调用sleep(),
所以要用Thread.currentThread().sleep()来睡眠...
评论
3 楼
bzhao
2017-06-01
我测试没啥区别啊!
2 楼
qq29oo
2016-08-17
感觉不对啊,通过实现Runnable接口来实现的线程里,使用Thread.sleep()没问题,但使用Thread.currentThread().sleep()的话 IDE会出现警告
1 楼
somefuture
2016-06-24
厉害,终于看到了
发表评论
-
[转]Spring Cloud微服务的那点事
2018-04-20 21:58 624转自:https://blog.csdn.ne ... -
[转]ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台
2018-04-20 17:10 846本文转自:https://my.oschin ... -
生成无重复的hashid短地址(短随机字符串)
2017-04-26 14:57 2131具体查看项目: http://hashids.org/j ... -
2017年Struts漏洞修复:版本从2.3.15.1升级到2.3.32
2017-03-24 15:10 1941如果你当前的项目使用了Struts2.3.5至 Strut ... -
多线程爬虫Miner [转]
2016-08-01 13:49 804多线程爬虫Miner 本文转自原作者博客:http:/ ... -
JAVA关键字替换
2015-11-03 21:22 1009import java.util.ArrayList; ... -
关于java web前后端分离
2015-08-27 22:47 1898由于公司架构上需要前后端分离,这里先记录一下相关内容,待后 ... -
基于NODEJS的前后端项目分离实践
2015-06-17 14:07 1141前后端分离项目实践 本文转自:http://jiangxi ... -
paypal IPN返回
2015-05-28 10:12 20141.设定返回的地址 目标:登录paypal-->用户 ... -
根据class搜索jar包
2015-05-20 13:00 823http://grepcode.com/ -
基于DWR的点对点聊天实现 server---client
2015-04-28 16:53 1055本文转自:http://htj1231825.iteye.c ... -
Java分布式中文分词组件word分词v1.2发布
2015-04-20 12:07 762word分词是一个Java实现的分布式的中文分词组件,提供了 ... -
java开源论坛jeebbsV4发布
2015-04-08 09:56 584论坛APP的帖子新展现形式 APP即时聊天模块 ... -
开源大数据解决方案
2015-03-12 13:01 1027解决方案 开发商 类型 描述 Storm Twit ... -
根据用户IP查询所属国家(数据库版)-geoip
2015-03-06 14:44 1148关键词:geoip,最新版本GeoIP2 http:// ... -
查询用户IP所在地服务接口(淘宝)
2015-03-04 10:17 1028import java.io.BufferedReader; ... -
java内存溢出优化
2014-12-28 12:42 2143本文转自:http://www.importnew.com ... -
Tomcat6线程池(Executor Thread pool)的配置
2014-12-27 01:07 883原文地址:http://www.java2000.net/p ... -
Netty学习系列导航-开源Java高性能NIO框架推荐
2014-08-13 17:49 1308纯记录,事件驱动服务器和客户端设计: http://mus ... -
破解验证码相关:用imagemagick和tesseract-ocr破解简单验证码
2014-08-13 17:08 2919本文源自:http://hooopo.iteye.com/ ...
相关推荐
System.out.println("Activity-->"+ Thread.currentThread().getName()); } Runnable r = new Runnable() { @Override public void run() { // TODO Auto-generated method stub try { Thread...
浏览器代码设计主要是确定对上述的设计的功能在代码上怎样实现,包括选用的程序语言和编程平台选择、程序代码的编写、程序代码的调试、程序功能的测试等等。 4.4 浏览器编程设计平台(老师讲解2学时,学生理解4学时...
Java图片拉伸变形实例,其实和图片缩放十分相似,图片翻折,绘制图像的Image对象和Grahpics对象,得到MediaTracker实例,for(int i=0; i(imageHeight/2); i ) { //实现图片的翻折效果 thread.sleep(30); //线程...
TextMessage msg = session.createTextMessage(Thread.currentThread().getName()+ "productor:我是大帅哥,我现在正在生产东西!,count:"+num); System.out.println(Thread.currentThread().getName()+ ...
import java.applet.*;...if (Thread.currentThread()==left) { x=x+10; if(x>360) x=10; mypen.setColor(Color.blue); mypen.drawArc(50,50,100,100,x,10); try{left.sleep(200);} catch(InterruptedException e){} }
() [单选题] * A.wait()(正确答案) B.sleep() C.yield() D.currentThread() 下面关于线程优先级的说法中,正确的是() [单选题] * A.线程的优先级是不能改变的 B.线程的优先级是在创建线程时设置的 C.在...
System.Threading.Thread.Sleep(800); // p.SessionId p.WaitForExit(); p.Close(); return true; } catch (Exception ex) { HttpContext.Current.Response.Write(ex); } return false; }
currentThread() 第9题 【单选题】【2.00分】【概念理解】 下面关于线程优先级的说法中,正确的是 [单选题] * A. 线程的优先级是不能改变的 B. 线程的优先级是在创建线程时设置的 C. 在创建线程后的任何时间都可以...
Report.RegisterThread(Report.GetCurrentWin32ThreadID(),Thread.CurrentThread); #region 获取当取线程的ThreadID [DllImport("Kernel32", EntryPoint = "GetCurrentThreadId", ExactSpelling = true)] ...
Report.RegisterThread(Report.GetCurrentWin32ThreadID(),Thread.CurrentThread); #region 获取当取线程的ThreadID [DllImport("Kernel32", EntryPoint = "GetCurrentThreadId", ExactSpelling = true)] ...
System.out.println(“ Jon:” + jobNumber +“正在被线程处理:” + Thread.currentThread()。 getName()); 尝试{Thread.sleep((int)(1000)); } catch(InterruptedException e){} System.out....
java多线程机制: 例子 1 public class Example1 { static Lefthand left;static Righthand right; public static void main(String args[]) { left=new Lefthand();... else if(Thread.currentThread()==right) ...
Thread.currentThread().sleep((v++)/3); } catch (InterruptedException e) {} } y_move = 400; g1.setColor(Color.black); while(y_move > y_click) { g1.fillOval(x_click-2,y_move,9,5); ...
Thread.sleep(100); } // Wait 100 milliseconds catch (InterruptedException e) { } // Ignore interruptions } } /** Start animating when the browser starts the applet */ public void ...
14)..Added: Support for showing current user processes only 15)..Added: Expanding environment variables for "Support URL" 16)..Fixed: Range-check error on systems with MBCS ACP 17)..Fixed: 64-bit ...
函数式:调用 _thread 模块中的start_new_thread()函数来产生新线程。 类:创建threading.Thread的子类来包装一个线程对象。 1.线程的创建 1.1 通过thread类直接创建 import threading import time def foo(n)...
要用到的Java知识点有:鼠标事件的监听,Graphics类和Thread类的应用。...然后实现烟花的缤纷闪烁效果,通过Thread类的Thread.currentThread().sleep()方法使当前线程睡眠,让用户欣赏到当前的绘制效果。最
Thread.Sleep(0); } } public void OnCompleted() { m_PlayEvent.Set(); m_Playing = false; } } public class WaveOutPlayer : IDisposable { private IntPtr m_WaveOut; private WaveOutBuffer m_...
private long threadSleep = -1; private static Logger log = Logger.getLogger(BasicPlayer.class.getName()); /** * These variables are used to distinguish stopped, paused, playing states. * We need ...
我就废话不多说了,还是直接看代码吧! from time import ctime ...线程名为:',threading.current_thread().name ) time.sleep(0.2) def b(x): #for i in range(5): print('Program b('+x+')