hugolib: Add a temporary workaround for page.copy() data race
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 5 Mar 2017 14:40:59 +0000 (15:40 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 5 Mar 2017 14:41:58 +0000 (15:41 +0100)
See ##3129

hugolib/page.go

index a6c890f795522525b98c7b7030128006947def80..8e09012e9befd02580a89d37377b3f147e563893 100644 (file)
@@ -1655,6 +1655,9 @@ func (p *Page) updatePageDates() {
 // copy creates a copy of this page with the lazy sync.Once vars reset
 // so they will be evaluated again, for word count calculations etc.
 func (p *Page) copy() *Page {
+       // This is a temporary workaround for the data race in #3129
+       p.getPermalink()
+
        c := *p
        c.pageInit = &pageInit{}
        return &c