diff --git a/projects/elinrin/pom.xml b/projects/elinrin/pom.xml
new file mode 100644
index 0000000..8fa945e
--- /dev/null
+++ b/projects/elinrin/pom.xml
@@ -0,0 +1,130 @@
+
+
+
+ 4.0.0
+
+
+ ru.mipt.diht.students
+ parent
+ 1.0-SNAPSHOT
+
+
+ ru.mipt.diht.students
+ ElinRin
+ 1.0-SNAPSHOT
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.7
+ 1.7
+
+
+
+
+
+ ElinRin
+ http://maven.apache.org
+
+ UTF-8
+
+
+
+
+ org.twitter4j
+ twitter4j-core
+ [4.0,)
+
+
+
+ org.twitter4j
+ twitter4j-stream
+ [4.0,)
+
+
+
+ com.beust
+ jcommander
+ 1.48
+
+
+
+ junit
+ junit
+ 4.12
+ test
+
+
+
+ org.mockito
+ mockito-core
+ 1.10.8
+ test
+
+
+ objenesis
+ org.objenesis
+
+
+
+
+
+ org.powermock
+ powermock-module-junit4
+ 1.6.1
+ test
+ true
+
+
+ junit
+ junit
+
+
+
+
+
+ org.powermock
+ powermock-api-mockito
+ 1.6.1
+ test
+ true
+
+
+ mockito-all
+ org.mockito
+
+
+
+
+
+
+ commons-io
+ commons-io
+ 2.4
+ test
+
+
+
+ com.beust
+ jcommander
+ 1.48
+
+
+
+ com.beust
+ jcommander
+ 1.48
+
+
+
+ com.beust
+ jcommander
+ 1.48
+
+
+
+
diff --git a/projects/elinrin/src/main/java/ru/mipt/diht/students/elinrin/threads/BlockingQueue.java b/projects/elinrin/src/main/java/ru/mipt/diht/students/elinrin/threads/BlockingQueue.java
new file mode 100644
index 0000000..2d9b413
--- /dev/null
+++ b/projects/elinrin/src/main/java/ru/mipt/diht/students/elinrin/threads/BlockingQueue.java
@@ -0,0 +1,89 @@
+package ru.mipt.diht.students.elinrin.threads;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+public class BlockingQueue {
+ private int maxQueueSize;
+ private Queue queue;
+ private Lock queueLock = new ReentrantLock();
+ private Lock offerLock = new ReentrantLock();
+ private Lock takeLock = new ReentrantLock();
+ private Object pushWait = new Object();
+ private Object popWait = new Object();
+
+ public final void offer(final List list) {
+ offerLock.lock();
+ try {
+ Integer last = 0;
+ while (last != list.size()) {
+ synchronized (popWait) {
+ while (queue.size() == maxQueueSize) {
+ try {
+ popWait.wait();
+ } catch (InterruptedException e) {
+ System.err.println(e.getMessage());
+ System.exit(1);
+ }
+ }
+ try {
+ queueLock.lock();
+ while (last < Integer.min(last + maxQueueSize - queue.size(), list.size())) {
+ queue.add(list.get(last));
+ last++;
+ }
+ } finally {
+ queueLock.unlock();
+ }
+ }
+ }
+ } finally {
+ synchronized (pushWait) {
+ pushWait.notifyAll();
+ }
+ offerLock.unlock();
+ }
+ }
+
+ public final List