summaryrefslogtreecommitdiff
path: root/philo.go
diff options
context:
space:
mode:
Diffstat (limited to 'philo.go')
-rw-r--r--philo.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/philo.go b/philo.go
index 7007a7a..f14c095 100644
--- a/philo.go
+++ b/philo.go
@@ -17,6 +17,7 @@ type Philo struct {
Rounds int
MaxDelay time.Duration
TimeOut time.Duration
+ Report chan string
}
func (p Philo) Delay() {
@@ -25,7 +26,7 @@ func (p Philo) Delay() {
}
func (p Philo) Print(s string) {
- fmt.Printf("%10s %s\n", p.Name, s)
+ p.Report <- fmt.Sprintf("%10s %s", p.Name, s)
}
func (p Philo) Arrive() stateFn {