Add an uncancellable usleep timer. Make the player and UDP thread cleanups uncancellable.

This commit is contained in:
Mike Brady
2018-11-29 11:37:56 +00:00
parent 7bf22b4265
commit c318796e55
5 changed files with 53 additions and 25 deletions
+10
View File
@@ -94,6 +94,16 @@ volatile int debuglev = 0;
sigset_t pselect_sigset;
int usleep_uncancellable(useconds_t usec) {
int response;
int oldState;
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
response = usleep_uncancellable(usec);
pthread_setcancelstate(oldState, NULL);
return response;
}
static uint16_t UDPPortIndex = 0;
void resetFreeUDPPort() {