Created
December 2, 2020 12:25
-
-
Save ryanivandsouza/f74de93f7c2af6802f9344f00c1bf29b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (host *Host) acceptRequest(philosopher *Philosopher, requestID int, wg *sync.WaitGroup) { | |
go func() { | |
<-host.servingAvailable | |
philosopher.eat() | |
}() | |
go func() { | |
<-philosopher.eatingEnded | |
host.servingAvailable <- "serving available" | |
wg.Done() | |
}() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment