door_linux.go 276 B

12345678910111213
  1. package door
  2. func (d *Door) setupChannels() {
  3. if d.ReaderCanClose {
  4. // Yes, expect Reader and Writer to stop
  5. d.wg.Add(2)
  6. } else {
  7. // Default: Only wait for the Writer to stop
  8. d.wg.Add(1)
  9. }
  10. go Reader(d.Config.Comm_handle, d)
  11. go Writer(d.Config.Comm_handle, d)
  12. }