diff --git a/bindings/java/src/net/hyperic/sigar/win32/Pdh.java b/bindings/java/src/net/hyperic/sigar/win32/Pdh.java index a92584ea..13aae5b0 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/Pdh.java +++ b/bindings/java/src/net/hyperic/sigar/win32/Pdh.java @@ -28,7 +28,7 @@ public class Pdh extends Win32Bindings { } } - public void close() throws Win32Exception { + public synchronized void close() throws Win32Exception { if (h_counter != -1l) { pdhRemoveCounter(h_counter); h_counter = -1l; diff --git a/bindings/java/src/net/hyperic/sigar/win32/RegistryKey.java b/bindings/java/src/net/hyperic/sigar/win32/RegistryKey.java index 35fda300..0076edce 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/RegistryKey.java +++ b/bindings/java/src/net/hyperic/sigar/win32/RegistryKey.java @@ -41,7 +41,7 @@ public class RegistryKey extends Win32Bindings this.m_hkey = hkey; } - public void close() + public synchronized void close() { if (this.m_hkey != 0) { RegCloseKey(this.m_hkey); diff --git a/bindings/java/src/net/hyperic/sigar/win32/Service.java b/bindings/java/src/net/hyperic/sigar/win32/Service.java index e4b0fcd0..2a3e1229 100644 --- a/bindings/java/src/net/hyperic/sigar/win32/Service.java +++ b/bindings/java/src/net/hyperic/sigar/win32/Service.java @@ -125,7 +125,7 @@ public class Service extends Win32Bindings implements java.io.Serializable this.close(); } - public void close() + public synchronized void close() { if(this.m_hService != 0) { CloseServiceHandle(this.m_hService);