Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
documentation tweaks
  • Loading branch information
kraih committed Jun 18, 2013
1 parent 47bf08d commit 7600e15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/Mojo/Server/Prefork.pm
Expand Up @@ -179,21 +179,21 @@ sub _spawn {
sub {

# Blocking ("ualarm" can't be imported on Windows)
my $l;
my $lock;
if ($_[1]) {
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
my $old = Time::HiRes::ualarm $self->lock_timeout * 1000000;
$l = flock $handle, LOCK_EX;
$lock = flock $handle, LOCK_EX;
Time::HiRes::ualarm $old;
};
if ($@) { $l = $@ eq "alarm\n" ? 0 : die($@) }
if ($@) { $lock = $@ eq "alarm\n" ? 0 : die($@) }
}

# Non blocking
else { $l = flock $handle, LOCK_EX | LOCK_NB }
else { $lock = flock $handle, LOCK_EX | LOCK_NB }

return $l;
return $lock;
}
);
$loop->unlock(sub { flock $handle, LOCK_UN });
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -657,7 +657,7 @@ Same for monitoring tasks.
$self->ua->post('https://example.com/bugs' => form => {exception => $e});
});

Or changes in behavior.
You can even extend much of the core functionality.

# Make controller object available to actions as $_
$self->hook(around_action => sub {
Expand Down

0 comments on commit 7600e15

Please sign in to comment.