From b868b89e042bcddbe1dcde660991b0b4f4766c1a Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Tue, 11 Sep 2012 06:44:35 +0800 Subject: [PATCH] sort workers use the first idle thread to build packages 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 --- depanneur | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depanneur b/depanneur index e177861..88301c8 100755 --- a/depanneur +++ b/depanneur @@ -609,7 +609,7 @@ sub createrepo 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))) { @@ -618,7 +618,7 @@ sub find_idle { last; } } - foreach my $w (keys %workers) { + foreach my $w (sort keys %workers) { if ( $workers{$w}->{state} eq 'idle' ) { $idle = $w; last; -- 2.7.4