Parallel automake: ordered output messages.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 26 Oct 2008 19:11:12 +0000 (20:11 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 26 Oct 2008 19:13:56 +0000 (20:13 +0100)
commit3fd0df9b84cdc9106907e4662103747838251f1c
tree15c3af1c3705d62c1b24012065dc1b4334186b7c
parent937775c8efa56c28891748aa75ab540a7a884315
Parallel automake: ordered output messages.

* lib/Automake/Channels.pm (%_default_options): New options
`ordered' default enabled, `queue', default zero (no queue),
`queue_key' default undefined.
(_merge_options): Ensure `ordered' channels cannot have fatal
messages or backtrace output.
(_enqueue, _dequeue): New functions, to push messages onto a
Thread::Queue, and output messages from such a queue, suitably
weeded for duplicates in the same manner as _print_message.
(_print_message): If the channel is ordered and has an
associated queue, then enqueue messages instead of printing
them.
(setup_channel_queue, pop_channel_queue): New functions,
to set a Thread::Queue for channels, and to flush a queue.
* lib/Automake/ChannelDefs.pm: Unset channel option `ordered'
for fatal, automake, and verb channels.
* automake.in (QUEUE_MESSAGE): New global constant, used as
serialization key.
(handle_makefiles_threaded): Create message queues for each
input file; workers queue messages, and the master outputs them
ordered, using the new Channels.pm functions.
* tests/parallel-am.test: Also check for ordered output (in the
absence of --add-missing races).
* tests/parallel-am2.test: New test; check for ordered output of
warning and (regular) error messages.
* tests/Makefile.am: Adjust.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
automake.in
lib/Automake/ChannelDefs.pm
lib/Automake/Channels.pm
tests/Makefile.am
tests/Makefile.in
tests/parallel-am.test
tests/parallel-am2.test [new file with mode: 0755]