From: Anthony Minessale Date: Mon, 27 Mar 2017 20:21:06 +0000 (-0500) Subject: FS-10167 auto change state when joining a thread out of the blue X-Git-Tag: v1.8.0~665 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa526a53635a3c18aa9d864998330d062526b5b4;p=thirdparty%2Ffreeswitch.git FS-10167 auto change state when joining a thread out of the blue --- diff --git a/libs/libks/src/ks_thread.c b/libs/libks/src/ks_thread.c index 92c608bd27..db1b690fa2 100644 --- a/libs/libks/src/ks_thread.c +++ b/libs/libks/src/ks_thread.c @@ -198,6 +198,10 @@ KS_DECLARE(uint8_t) ks_thread_priority(ks_thread_t *thread) { KS_DECLARE(ks_status_t) ks_thread_join(ks_thread_t *thread) { + if (thread->state == KS_THREAD_RUNNING) { + thread->state = KS_THREAD_SHUTDOWN; + } + if (thread->joined) { return KS_STATUS_DUPLICATE_OPERATION; }