Fix: Fix synchronization of LTTngAgent#dispose
[lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / LTTngAgent.java
index c98301d738b8aa3a81f17ce240e687c88a047794..6b4f0135de08e4f05ffd0fa8ab472f55d6ddd212 100644 (file)
@@ -52,10 +52,12 @@ public class LTTngAgent {
         * logging. This dispose function is non-static for backwards
         * compatibility purposes.
         */
-       public synchronized void dispose() {
-               if (instance != null) {
-                       instance.disposeInstance();
-                       instance = null;
+       public void dispose() {
+               synchronized (LTTngAgent.class) {
+                       if (instance != null) {
+                               instance.disposeInstance();
+                               instance = null;
+                       }
                }
                return;
        }
This page took 0.023672 seconds and 4 git commands to generate.