diff options
author | Oliver Tappe | 2009-06-09 20:05:47 +0200 |
---|---|---|
committer | Oliver Tappe | 2009-06-09 20:05:47 +0200 |
commit | 4a683e74a6afd9896df3c32b9d9d334e4599f7d3 (patch) | |
tree | 1513b6f3aac3d803f22022401cc470d97d45d796 /lib | |
parent | * fixed pretty stupid bug that involved mixed use of bufferd/non-buffered IO (diff) | |
download | core-4a683e74a6afd9896df3c32b9d9d334e4599f7d3.tar.gz core-4a683e74a6afd9896df3c32b9d9d334e4599f7d3.tar.xz core-4a683e74a6afd9896df3c32b9d9d334e4599f7d3.zip |
* fixed a whole lot of circular references which I found when researching #451
* some minor cleanups along the way
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2944 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib')
-rw-r--r-- | lib/OpenSLX/Basics.pm | 10 | ||||
-rw-r--r-- | lib/OpenSLX/ScopedResource.pm | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/OpenSLX/Basics.pm b/lib/OpenSLX/Basics.pm index e5bb4e4d..e125cd7e 100644 --- a/lib/OpenSLX/Basics.pm +++ b/lib/OpenSLX/Basics.pm @@ -90,6 +90,10 @@ I<slxsettings>-script, so please look there if you'd like to know more. # options useful during development only: # 'debug-confess' => '0', + # + # only settable programmatically: + # + 'log-pids' => '0', # # extended settings follow, which are only supported by slxsettings, @@ -271,7 +275,11 @@ sub vlog if (substr($str, -1, 1) ne "\n") { $str .= "\n"; } - print $openslxLog $str; + if ($openslxConfig{'log-pids'}) { + print $openslxLog "$$: $str"; + } else { + print $openslxLog $str; + } return; } diff --git a/lib/OpenSLX/ScopedResource.pm b/lib/OpenSLX/ScopedResource.pm index 3334ecde..af912691 100644 --- a/lib/OpenSLX/ScopedResource.pm +++ b/lib/OpenSLX/ScopedResource.pm @@ -152,14 +152,14 @@ sub _release { my $self = shift; - # ignore ctrl-c while we are trying to release the resource, as otherwise - # the resource would be leaked - local $SIG{INT} = 'IGNORE'; - # only release the resource if invoked by the owning process vlog(3, "process $$ tries to release resource $self->{name}"); return if $self->{owner} != $$; + # ignore ctrl-c while we are trying to release the resource, as otherwise + # the resource would be leaked + local $SIG{INT} = 'IGNORE'; + # release the resource and unset owner if ($self->{release}->()) { vlog(1, "process $$ released resource $self->{name}"); |