From 0027de0a544438f146cfc94f005fd6f4ba9f94d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Fri, 8 May 2009 18:42:37 +0000 Subject: * 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. --- usr/local/pkg/miniupnpd.inc | 8 -------- 1 file changed, 8 deletions(-) (limited to 'usr/local/pkg') diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index 0f74540..57a5ec4 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -62,8 +62,6 @@ function before_form_miniupnpd($pkg) { global $config; - config_lock(); - /* if shaper connection speed defined hide fields */ if($config['ezshaper']['step2']['download'] && $config['ezshaper']['step2']['upload']) { $i=0; @@ -73,8 +71,6 @@ $i++; } } - - config_unlock(); } function validate_form_miniupnpd($post, $input_errors) { @@ -118,8 +114,6 @@ global $config; global $input_errors; - config_lock(); - $upnp_config = $config['installedpackages']['miniupnpd']['config'][0]; $config_file = '/var/etc/miniupnpd.conf'; @@ -238,7 +232,5 @@ unlink($config_file); } } - - config_unlock(); } ?> -- cgit v1.1