fix to release incorrectly lock when it is failed to obtain lock (#5610)
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
parent
a45f615b6d
commit
f39c0dd274
|
|
@ -78,8 +78,8 @@ public class ConsumeDriver<T> implements IDriver {
|
|||
if (running) {
|
||||
return;
|
||||
}
|
||||
lock.lock();
|
||||
try {
|
||||
lock.lock();
|
||||
this.allocateBuffer2Thread();
|
||||
for (ConsumerThread consumerThread : consumerThreads) {
|
||||
consumerThread.start();
|
||||
|
|
@ -116,8 +116,8 @@ public class ConsumeDriver<T> implements IDriver {
|
|||
|
||||
@Override
|
||||
public void close(Channels channels) {
|
||||
lock.lock();
|
||||
try {
|
||||
lock.lock();
|
||||
this.running = false;
|
||||
for (ConsumerThread consumerThread : consumerThreads) {
|
||||
consumerThread.shutdown();
|
||||
|
|
|
|||
Loading…
Reference in New Issue