mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
删除多余代码
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@278 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package com.alibaba.druid;
|
||||
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.util.LinkedTransferQueue;
|
||||
|
||||
public class TestLinkedTransferQueue extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
final Lock lock = new ReentrantLock();
|
||||
|
||||
lock.lock();
|
||||
|
||||
final LinkedTransferQueue<Object> q = new LinkedTransferQueue<Object>();
|
||||
|
||||
Thread takeThread = new Thread("Take Thread") {
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
for (;;) {
|
||||
q.take();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
takeThread.start();
|
||||
|
||||
// q.take();
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
Object value = i;
|
||||
q.transfer(value);
|
||||
}
|
||||
|
||||
q.put(1);
|
||||
q.put(2);
|
||||
System.out.println(q.size());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user