Go
go\t\npackage main\n\nimport (\n\t"fmt"\n\t"time"\n)\n\nvar (\n\tsignal = make(chan struct{})\n)\n\nfunc foo(n int) {\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Print
```go\t\npackage main\n\nimport (\n\t"fmt"\n\t"time"\n)\n\nvar (\n\tsignal = make(chan struct{})\n)\n\nfunc foo(n int) {\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Print("foo")\n\t\tsignal <- struct{}{}\n\t}\n}\n\nfunc bar(n int) {\n\tfor i := 0; i < n; i++ {\n\t\t<-signal\n\t\tfmt.Print("bar")\n\n\t}\n}\n\nfunc main() {\n\tn := 5\n\tgo foo(n)\n\tgo bar(n)\n\n\ttime.Sleep(2 * time.Second)\n}\n\n```
[]