mirror of https://github.com/wolfSSL/wolfssh.git
Linux-Semaphore
1. Made a similar change for Linux semaphores. 2. Moved the check for the quit flag in the windowMonitor.pull/580/head
parent
503e1bb288
commit
526ade03df
|
@ -254,12 +254,12 @@ static THREAD_RET windowMonitor(void* in)
|
||||||
do {
|
do {
|
||||||
#if (defined(__OSX__) || defined(__APPLE__))
|
#if (defined(__OSX__) || defined(__APPLE__))
|
||||||
dispatch_semaphore_wait(windowSem, DISPATCH_TIME_FOREVER);
|
dispatch_semaphore_wait(windowSem, DISPATCH_TIME_FOREVER);
|
||||||
if (args->quit) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
sem_wait(&windowSem);
|
sem_wait(&windowSem);
|
||||||
#endif
|
#endif
|
||||||
|
if (args->quit) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
ret = sendCurrentWindowSize(args);
|
ret = sendCurrentWindowSize(args);
|
||||||
(void)ret;
|
(void)ret;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
@ -895,7 +895,11 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
|
||||||
pthread_join(thread[2], NULL);
|
pthread_join(thread[2], NULL);
|
||||||
/* Wake the windowMonitor thread so it can exit. */
|
/* Wake the windowMonitor thread so it can exit. */
|
||||||
arg.quit = 1;
|
arg.quit = 1;
|
||||||
|
#if (defined(__OSX__) || defined(__APPLE__))
|
||||||
dispatch_semaphore_signal(windowSem);
|
dispatch_semaphore_signal(windowSem);
|
||||||
|
#else
|
||||||
|
sem_post(&windowSem);
|
||||||
|
#endif
|
||||||
pthread_join(thread[0], NULL);
|
pthread_join(thread[0], NULL);
|
||||||
pthread_cancel(thread[1]);
|
pthread_cancel(thread[1]);
|
||||||
#if (defined(__OSX__) || defined(__APPLE__))
|
#if (defined(__OSX__) || defined(__APPLE__))
|
||||||
|
|
Loading…
Reference in New Issue