gold patch committed: Fix race condition with --threads

Ian Lance Taylor iant@google.com
Thu Feb 11 07:44:00 GMT 2010


Paul Pluzhnikov, with some effort, managed to produce a repeatable
race condition when using gold --threads.  After poring over it for a
while, I realized that I had idiotically assumed that I could
increment the number of blockers on a token even after queuing jobs to
start.  The race occurred when the jobs finished while I was still
incrementing the number of blockers.  I committed this patch to fix
the problem.

Ian


2010-02-10  Ian Lance Taylor  <iant@google.com>

	* dirsearch.cc (Dirsearch::initialize): Add all blockers before
	queueing any tasks.
	* gold.cc (queue_middle_gc_tasks): Likewise.  Fix final blocker.
	(queue_middle_tasks): Add all blockers before queueing any tasks.
	(queue_final_tasks): Likewise.
	* token.h (Task_token::add_blockers): New function.
	* object.h (Input_objects::number_of_relobjs): New function.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 9926 bytes
Desc: locks
URL: <https://sourceware.org/pipermail/binutils/attachments/20100211/aba97983/attachment.bin>


More information about the Binutils mailing list