sort workers using keys to use the build worker with smallest
id. Without this patch build worker use order is 1,3,0,2,...
but it should be 0,1,2,3,...
This is necessary to make gbs back compatible while building single
package.
Change-Id: Ief248542194d697535387753a13200b426b8fcb6
sub find_idle {
my $idle = -1;
- foreach my $w (keys %workers) {
+ foreach my $w (sort keys %workers) {
my $tid = $workers{$w}->{tid};
my $state = $workers{$w}->{state};
if (! defined(threads->object($tid))) {
last;
}
}
- foreach my $w (keys %workers) {
+ foreach my $w (sort keys %workers) {
if ( $workers{$w}->{state} eq 'idle' ) {
$idle = $w;
last;