Fixed race condition at the edge of builds. Using queue channel.
The last loop collecting the remaining objectFiles may be run before the last jobs completes. This commit replaces the two channels used to fill objectFiles and to signal error with direct variable access guarded by mutex, this avoids race conditions at the end and streamlines the whole process. Also added a 'queue' channel to feed the goroutines, this is not strictly part of the fix, but helps to fairly distribute the workload.
Showing
Please register or sign in to comment