View | Details | Raw Unified | Return to bug 51888
Collapse All | Expand All

(-)src/core/org/apache/jmeter/threads/JMeterThread.java (-7 / +11 lines)
Lines 321-333 Link Here
321
            log.error("Test failed!", e);
321
            log.error("Test failed!", e);
322
        } finally {
322
        } finally {
323
            currentSampler = null; // prevent any further interrupts
323
            currentSampler = null; // prevent any further interrupts
324
            interruptLock.lock();  // make sure current interrupt is finished, prevent another starting yet
324
            try {
325
            threadContext.clear();
325
                interruptLock.lock();  // make sure current interrupt is finished, prevent another starting yet
326
            log.info("Thread finished: " + threadName);
326
                threadContext.clear();
327
            threadFinished(iterationListener);
327
                log.info("Thread finished: " + threadName);
328
            monitor.threadFinished(this); // Tell the engine we are done
328
                threadFinished(iterationListener);
329
            JMeterContextService.removeContext(); // Remove the ThreadLocal entry
329
                monitor.threadFinished(this); // Tell the engine we are done
330
            interruptLock.unlock(); // Allow any pending interrupt to complete (OK because currentSampler == null)
330
                JMeterContextService.removeContext(); // Remove the ThreadLocal entry
331
            }
332
            finally {
333
                interruptLock.unlock(); // Allow any pending interrupt to complete (OK because currentSampler == null)
334
            }
331
        }
335
        }
332
    }
336
    }
333
337

Return to bug 51888