Project

General

Profile

« Previous | Next » 

Revision 0027de0a

Added by Ermal Luçi about 16 years ago

  • Create two new functions lock($subsystem)/unlock() to have more reliable locking using semaphores.
    This function can sleep till the resource is free and can help find not well behaving code.
  • Remove most of the config_lock/config_unlock logics on the whole scripts/pages it is an abuse of this.
    If any sybsytem wants to lock can do so with its own lock.
  • Lock the config when doing a filter reload to avoid parallell recursion on this function, since it is not reentrant.
    This compenstates for the removal of lock aquiring from the scripts/pages.
  • config_lock/config_unlock are now compate shims that do nothing. They are preserved since packages 'abuse' them too.

View differences:

usr/local/www/services_dhcp.php
302 302
		$retval = 0;
303 303
		$retvaldhcp = 0;
304 304
		$retvaldns = 0;
305
		config_lock();
306 305
		/* Stop DHCP so we can cleanup leases */
307 306
		killbyname("dhcpd");
308 307
		dhcp_clean_leases();
......
323 322
					unlink($d_staticmapsdirty_path);
324 323
			}
325 324
		}	
326
		config_unlock();
327 325
		if($retvaldhcp == 1 || $retvaldns == 1)
328 326
			$retval = 1;
329 327
		$savemsg = get_std_save_message($retval);

Also available in: Unified diff