We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1506488 commit a1b33a9Copy full SHA for a1b33a9
core/src/main/java/org/mini2Dx/miniscript/core/util/AbstractConcurrentQueue.java
@@ -157,6 +157,13 @@ public E remove() {
157
158
@Override
159
public E poll() {
160
+ lock.lockRead();
161
+ if(internalQueue.isEmpty()) {
162
+ lock.unlockRead();
163
+ return null;
164
+ }
165
166
+
167
lock.lockWrite();
168
try {
169
return internalQueue.poll();
@@ -177,6 +184,13 @@ public E element() {
177
184
178
185
179
186
public E peek() {
187
188
189
190
191
192
193
180
194
lock.lockRead();
181
195
182
196
return internalQueue.peek();
0 commit comments