diff options
Diffstat (limited to 'lib/Automake/Channels.pm')
-rw-r--r-- | lib/Automake/Channels.pm | 119 |
1 files changed, 2 insertions, 117 deletions
diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm index 9fd513f31..2e810f55d 100644 --- a/lib/Automake/Channels.pm +++ b/lib/Automake/Channels.pm @@ -43,13 +43,6 @@ Automake::Channels - support functions for error and warning management # Turn on all channels of type 'warning'. setup_channel_type 'warning', silent => 0; - # Redirect all channels to push messages on a Thread::Queue using - # the specified serialization key. - setup_channel_queue $queue, $key; - - # Output a message pending in a Thread::Queue. - pop_channel_queue $queue; - # Treat all warnings as errors. $warnings_are_errors = 1; @@ -81,7 +74,6 @@ use vars qw (@ISA @EXPORT %channels $me); &setup_channel &setup_channel_type &dup_channel_setup &drop_channel_setup &buffer_messages &flush_messages - &setup_channel_queue &pop_channel_queue US_GLOBAL US_LOCAL UP_NONE UP_TEXT UP_LOC_TEXT); @@ -181,11 +173,6 @@ The file where the error should be output. Whether the channel should be silent. Use this do disable a category of warning, for instance. -=item C<ordered =E<gt> 1> - -Whether, with multi-threaded execution, the message should be queued -for ordered output. - =item C<uniq_part =E<gt> UP_LOC_TEXT> The part of the message subject to duplicate filtering. See the @@ -269,9 +256,6 @@ use vars qw (%_default_options %_global_duplicate_messages exit_code => 1, file => \*STDERR, silent => 0, - ordered => 1, - queue => 0, - queue_key => undef, uniq_scope => US_LOCAL, uniq_part => UP_LOC_TEXT, header => '', @@ -343,13 +327,6 @@ sub _merge_options (\%%) confess "unknown option '$_'"; } } - if ($hash->{'ordered'}) - { - confess "fatal messages cannot be ordered" - if $hash->{'type'} eq 'fatal'; - confess "backtrace cannot be output on ordered messages" - if $hash->{'backtrace'}; - } } =item C<register_channel ($name, [%options])> @@ -433,63 +410,6 @@ sub _format_message ($$%) return $msg; } -# _enqueue ($QUEUE, $KEY, $UNIQ_SCOPE, $TO_FILTER, $MSG, $FILE) -# ------------------------------------------------------------- -# Push message on a queue, to be processed by another thread. -sub _enqueue ($$$$$$) -{ - my ($queue, $key, $uniq_scope, $to_filter, $msg, $file) = @_; - $queue->enqueue ($key, $msg, $to_filter, $uniq_scope); - confess "message queuing works only for STDERR" - if $file ne \*STDERR; -} - -# _dequeue ($QUEUE) -# ----------------- -# Pop a message from a queue, and print, similarly to how -# _print_message would do it. Return 0 if the queue is -# empty. Note that the key has already been dequeued. -sub _dequeue ($) -{ - my ($queue) = @_; - my $msg = $queue->dequeue || return 0; - my $to_filter = $queue->dequeue; - my $uniq_scope = $queue->dequeue; - my $file = \*STDERR; - - if ($to_filter ne '') - { - # Do we want local or global uniqueness? - my $dups; - if ($uniq_scope == US_LOCAL) - { - $dups = \%_local_duplicate_messages; - } - elsif ($uniq_scope == US_GLOBAL) - { - $dups = \%_global_duplicate_messages; - } - else - { - confess "unknown value for uniq_scope: " . $uniq_scope; - } - - # Update the hash of messages. - if (exists $dups->{$to_filter}) - { - ++$dups->{$to_filter}; - return 1; - } - else - { - $dups->{$to_filter} = 0; - } - } - print $file $msg; - return 1; -} - - # _print_message ($LOCATION, $MESSAGE, %OPTIONS) # ---------------------------------------------- # Format the message, check duplicates, and print it. @@ -561,15 +481,7 @@ sub _print_message ($$%) } } my $file = $opts{'file'}; - if ($opts{'ordered'} && $opts{'queue'}) - { - _enqueue ($opts{'queue'}, $opts{'queue_key'}, $opts{'uniq_scope'}, - $to_filter, $msg, $file); - } - else - { - print $file $msg; - } + print $file $msg; return 1; } @@ -662,7 +574,7 @@ sub msg ($$;$%) confess if $opts{'backtrace'}; if ($opts{'type'} eq 'fatal') { - # flush messages explicitly here, needed in worker threads. + # Flush messages explicitly here, for extra safety. STDERR->flush; exit $exit_code; } @@ -777,33 +689,6 @@ sub flush_messages () @backlog = (); } -=item C<setup_channel_queue ($queue, $key)> - -Set the queue to fill for each channel that is ordered, -and the key to use for serialization. - -=cut -sub setup_channel_queue ($$) -{ - my ($queue, $key) = @_; - foreach my $channel (keys %channels) - { - setup_channel $channel, queue => $queue, queue_key => $key - if $channels{$channel}{'ordered'}; - } -} - -=item C<pop_channel_queue ($queue)> - -pop a message off the $queue; the key has already been popped. - -=cut -sub pop_channel_queue ($) -{ - my ($queue) = @_; - return _dequeue ($queue); -} - =back =head1 SEE ALSO |