summaryrefslogtreecommitdiff
path: root/philo.go
diff options
context:
space:
mode:
Diffstat (limited to 'philo.go')
-rw-r--r--philo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/philo.go b/philo.go
index 1e26799..43bc6c7 100644
--- a/philo.go
+++ b/philo.go
@@ -91,6 +91,11 @@ func prepare(n int) []chan bool {
return forks
}
+func init() {
+ now := time.Now().Unix()
+ rand.Seed(now)
+}
+
func main() {
fmt.Println(len(philo), "philosophers dining")
defer fmt.Println("Table is empty")