X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/8bd9a0d82f7e21d9340a4470258e2cad2638deca..bca3eed65c50f585248ae3a1cc8bb6a74e4e8bb8:/selfforum-cgi/shared/Template/Forum.pm diff --git a/selfforum-cgi/shared/Template/Forum.pm b/selfforum-cgi/shared/Template/Forum.pm index 6754941..5183561 100644 --- a/selfforum-cgi/shared/Template/Forum.pm +++ b/selfforum-cgi/shared/Template/Forum.pm @@ -16,7 +16,7 @@ use vars qw( $VERSION ); -use Lock qw(:READ); +use Lock; use Encode::Plain; $Encode::Plain::utf8 = 1; use Posting::_lib qw( get_all_threads @@ -56,10 +56,10 @@ sub print_forum_as_HTML ($$$) { my $template = new Template $tempfile; my ($threads, $stat); + my $main = new Lock ($mainfile); - unless ($stat = lock_file ($mainfile)) { - if (defined $stat) { - violent_unlock_file ($mainfile); + unless ($main -> lock (LH_SHARED)) { + unless ($main -> masterlocked) { print ${$template -> scrap ( $assign -> {errorDoc}, { $assign -> {errorText} => $template -> insert ($assign -> {'occupied'}) } @@ -81,8 +81,8 @@ sub print_forum_as_HTML ($$$) { # eval {setpriority 0,0,1}; - $threads = get_all_threads ($mainfile, $param -> {showDeleted}, $view -> {sortedMsg}); - violent_unlock_file ($mainfile) unless (unlock_file ($mainfile)); + $threads = get_all_threads ($main -> filename, $param -> {showDeleted}, $view -> {sortedMsg}); + $main -> unlock; print ${$template -> scrap ( $assign -> {mainDocStart}, @@ -105,7 +105,6 @@ sub print_forum_as_HTML ($$$) { for (@threads) { $tpar -> {thread} = "$_"; - $|++; print ${html_thread ($threads -> {$_}, $template, $tpar)},"\n",'