Skip to content

Commit

Permalink
Formatting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 10, 2014
1 parent a566ec7 commit 1739b57
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/Inline/C.pm
Expand Up @@ -8,7 +8,7 @@ use Data::Dumper;
use Carp;
use Cwd qw(cwd abs_path);
use File::Spec;
use constant{IS_WIN32 => $^O eq 'MSWin32'};
use constant IS_WIN32 => $^O eq 'MSWin32';
use if !IS_WIN32, Fcntl => ':flock';
use if IS_WIN32, 'Win32::Mutex';

Expand Down Expand Up @@ -320,12 +320,13 @@ sub build {
$total_build_time = Time::HiRes::time();
}
my ($file, $lockfh);
if(IS_WIN32) {
if (IS_WIN32) {
#this can not look like a file path, it can't start with "C:/", or new() fails
$file = 'Inline__C_'.$o->{API}{directory}.'.lock';
$file = 'Inline__C_' . $o->{API}{directory} . '.lock';
$lockfh = Win32::Mutex->new(1, $file) or die "lockmutex $file: $^E";
} else {
$file = File::Spec->catfile($o->{API}{directory},'.lock');
}
else {
$file = File::Spec->catfile($o->{API}{directory}, '.lock');
open $lockfh, '>', $file or die "lockfile $file: $!";
flock($lockfh, LOCK_EX) or die "flock: $!\n" if $^O !~ /^VMS|riscos|VOS$/;
}
Expand All @@ -336,9 +337,10 @@ sub build {
$o->call('write_Inline_headers', 'Build Glue 2');
$o->call('write_Makefile_PL', 'Build Glue 3');
$o->call('compile', 'Build Compile');
if(IS_WIN32) {
if (IS_WIN32) {
$lockfh->release or die "releasemutex $file: $^E";
} else {
}
else {
flock($lockfh, LOCK_UN) if $^O !~ /^VMS|riscos|VOS$/;
}
if ($o->{CONFIG}{BUILD_TIMERS}) {
Expand Down

0 comments on commit 1739b57

Please sign in to comment.