synchronize close methods that are invoked by the finalize method
This commit is contained in:
parent
8af7281e69
commit
894b300ad0
|
@ -28,7 +28,7 @@ public class Pdh extends Win32Bindings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() throws Win32Exception {
|
public synchronized void close() throws Win32Exception {
|
||||||
if (h_counter != -1l) {
|
if (h_counter != -1l) {
|
||||||
pdhRemoveCounter(h_counter);
|
pdhRemoveCounter(h_counter);
|
||||||
h_counter = -1l;
|
h_counter = -1l;
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class RegistryKey extends Win32Bindings
|
||||||
this.m_hkey = hkey;
|
this.m_hkey = hkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close()
|
public synchronized void close()
|
||||||
{
|
{
|
||||||
if (this.m_hkey != 0) {
|
if (this.m_hkey != 0) {
|
||||||
RegCloseKey(this.m_hkey);
|
RegCloseKey(this.m_hkey);
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class Service extends Win32Bindings implements java.io.Serializable
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close()
|
public synchronized void close()
|
||||||
{
|
{
|
||||||
if(this.m_hService != 0) {
|
if(this.m_hService != 0) {
|
||||||
CloseServiceHandle(this.m_hService);
|
CloseServiceHandle(this.m_hService);
|
||||||
|
|
Loading…
Reference in New Issue