hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 0282c922b4d788dcb9a281f036fe24280edd0054
parent c5ae2a2d1d0ceffbdb88a90f00519dfaec3806d6
Author: spf13 <steve.francia@gmail.com>
Date:   Mon, 24 Nov 2014 17:51:47 -0500

fixing race condition in CreatePages

Diffstat:
Mhugolib/site.go | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -343,8 +343,8 @@ func (s *Site) CreatePages() error {
 
 	wg := &sync.WaitGroup{}
 
+	wg.Add(procs * 4)
 	for i := 0; i < procs*4; i++ {
-		wg.Add(1)
 		go sourceReader(s, filechan, results, wg)
 	}
 
@@ -372,14 +372,9 @@ func (s *Site) CreatePages() error {
 
 	wg = &sync.WaitGroup{}
 
+	wg.Add(2 * procs * 4)
 	for i := 0; i < procs*4; i++ {
-		wg.Add(1)
 		go fileConverter(s, fileConvChan, results, wg)
-	}
-
-	wg = &sync.WaitGroup{}
-	for i := 0; i < procs*4; i++ {
-		wg.Add(1)
 		go pageConverter(s, pageChan, results, wg)
 	}