Commit 06c072f
authored
STAR-1582 Fix deadlock on client stop (#32)
Fix deadlock when shutting down a client, which would get stuck indefinitly 1 out of 5 times in the main thread when calling stop. The
deadlock was casued by the main thread getting stuck while
waiting for the client thread to join. At the same time, the client worker thread was stuck waiting for recv to return a value. In case no data was sent on the network and the remote side did not disconnect, the main thread will be stuck indefinitly. This commit solves the issue by first closing the SRT socket before trying to join the thread, instead of after, as earlier. This makes the recv call return an error and exit the thread loop.1 parent 0f49f18 commit 06c072f
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
899 | 899 | | |
900 | 900 | | |
901 | 901 | | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | 902 | | |
907 | 903 | | |
908 | 904 | | |
| |||
912 | 908 | | |
913 | 909 | | |
914 | 910 | | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
915 | 916 | | |
916 | 917 | | |
917 | 918 | | |
| |||
0 commit comments