public static synchronized void markClosed(PooledDataSource pds) { unclosedPooledDataSources.remove(pds); mc.attemptUnmanagePooledDataSource(pds); if (unclosedPooledDataSources.isEmpty()) { mc.attemptUnmanageC3P0Registry(); registry_mbean_registered = false; } }