synchronize close methods that are invoked by the finalize method

This commit is contained in:
Doug MacEachern 2005-02-20 00:06:25 +00:00
parent 8af7281e69
commit 894b300ad0
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);