Commit
9355f049 changed the dispose() back to non-static. However,
"static synchronized" and "synchronized" are not the same thing!
The latter synchronizes on the instance, but the former synchronizes
on the class object.
In this case we need to synchronize on the class object manually.
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* 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;
}