try{
this_mon.enter();
if ( suspend_level > 0 ){
save_outstanding = true;
return;
}
Map map = new HashMap();
List list = new ArrayList();
map.put("resources", list);
ShareResource[] shares = manager.getShares();
for (int i=0;i<shares.length;i++){
Map m = new HashMap();
((ShareResourceImpl)shares[i]).serialiseResource( m );
list.add( m );
}
FileUtil.writeResilientConfigFile("sharing.config", map);
}finally{
this_mon.exit();
}