ViewDidLoad运行多次的问题
2012-03-09 11:32
176 查看
int consume() throws KeeperException, InterruptedException{ int retvalue = -1; Stat stat = null; while (true) { synchronized (mutex) { List<String> list = zk.getChildren(root, true); if (list.size() == 0) { mutex.wait(); } else { Integer min = new Integer(list.get(0).substring(7)); for(String s : list){ Integer tempValue = new Integer(s.substring(7)); if(tempValue < min) min = tempValue; } byte[] b = zk.getData(root + "/element" + min,false, stat); zk.delete(root + "/element" + min, 0); ByteBuffer buffer = ByteBuffer.wrap(b); retvalue = buffer.getInt(); return retvalue; } } } }
相关文章推荐
- Python守护线程被多次运行的问题【摘记】
- 关于quartz重复多次运行问题
- 解决java Android 中同一个线程多次运行问题
- C语言中连续多次scanf无法成功运行的问题简析
- 如何防止程序被多次运行问题的讨论
- 有关viewController中viewDidLoad方法执行多次的问题
- 【原创】ASP.NET中Application_Start“多次运行”的问题
- ApplicationContextAware和ClassPathXmlApplicationContext(Spring定时任务运行多次问题)
- 多次运行一个存储过程时一些模忽问题
- android Dalvikvm GC 多次运行 引起UI主线程卡顿问题
- 关于C语言中连续多次scanf无法成功运行的问题简析
- 用winsock编的客户端与服务端在本地运行时,互相之间的通信是否过网卡的问题
- sphinx0.99运行到centos6系统下遇到的问题
- 运行之前系统定制化脚本(冷)出现的问题和剔除“/根”目标
- 在Windows 2003下运行VMware碰到的问题
- flask运行数据库生成脚本的一些问题
- Eclipse运行C++问题Launch failed,Binary not found
- 在Python27中运行pip install dlib装载库dlib所引起的问题解决
- opencv出现不能运行release版本的问题
- 关于控制台应用程序无法在其他电脑上运行的问题