智盟项目

23 lines
270 B

  1. package task
  2. import (
  3. "applet/app/task/svc"
  4. "math/rand"
  5. "time"
  6. )
  7. //
  8. func taskCinema5bms() {
  9. for {
  10. if len(ch) > workerNum {
  11. time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000)))
  12. } else {
  13. goto START
  14. }
  15. }
  16. START:
  17. ch <- 1
  18. svc.Cinema5bms()
  19. <-ch
  20. }