Haivision / srtgo

Go bindings for SRT. Advantages of SRT technology for an easy to use programming language
Mozilla Public License 2.0
185 stars 52 forks source link

Windows build and SetDeadline deadlock fixes #72

Open ddv2005 opened 4 months ago

ddv2005 commented 4 months ago

There are 2 fixes:

  1. accept.go can't be compiled under Windows because of missing syscall.SizeofSockaddrAny
  2. SetDeadline has deadlock because it calls pd.lock.Lock() at the start and then in unblock it tried to call pd.lock.Lock() again. But mutexes in go are different from posix because Go mutexes cannot be locked again even in the same thread/coroutine. Also, locks in poll.unblock are unnecessary and can be replaced by one SwapInt32 instead of load and store.