mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
尝试一个新的DruidDataSource
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@260 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.alibaba.druid;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.util.LinkedTransferQueue;
|
||||
|
||||
public class TestLinkedTransferQueue extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
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();
|
||||
q.put(1);
|
||||
q.put(2);
|
||||
System.out.println(q.size());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user