TSBM - queue.take blocking
- Dominant language
- Jupyter Notebook
- Stars
- 24
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
queue.take() will hang forever and block thread2.join and thread3.join later. You can use queue.poll(timeout, unit) instead.
@@ -255,9 +258,9 @@ public class TSBM {
break;
}
try {
- String data = queue.take();
+ String data = queue.poll(100, TimeUnit.MILLISECONDS);
if (data == null) {
- Thread.sleep(100);
+ //Thread.sleep(100);
continue;
}
adapter.insertData(data);
@@ -265,6 +268,7 @@ public class TSBM {
e.printStackTrace();
}

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.