packer/plugin: remove race in Exited()

This commit is contained in:
Mitchell Hashimoto 2013-08-21 11:00:07 -07:00
parent c05b6d628b
commit 5559e49df3
1 changed files with 2 additions and 0 deletions

View File

@ -122,6 +122,8 @@ func NewClient(config *ClientConfig) (c *Client) {
// Tells whether or not the underlying process has exited. // Tells whether or not the underlying process has exited.
func (c *Client) Exited() bool { func (c *Client) Exited() bool {
c.l.Lock()
defer c.l.Unlock()
return c.exited return c.exited
} }