You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apm-commons/apm-datacarrier/src/main/java/org/apache/skywalking/apm/commons/datacarrier/consumer/ConsumeDriver.java
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
* Pool of consumers <p> Created by wusheng on 2016/10/25.
28
28
*/
29
29
publicclassConsumeDriver<T> implementsIDriver {
30
-
privatebooleanrunning;
30
+
privatevolatilebooleanrunning;
31
31
privateConsumerThread[] consumerThreads;
32
32
privateChannels<T> channels;
33
33
privateReentrantLocklock;
@@ -88,6 +88,9 @@ public void begin(Channels channels) {
88
88
}
89
89
lock.lock();
90
90
try {
91
+
if (running) {
92
+
return;
93
+
}
91
94
this.allocateBuffer2Thread();
92
95
for (ConsumerThreadconsumerThread : consumerThreads) {
0 commit comments