summaryrefslogtreecommitdiff
path: root/pjlib/src/pj
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src/pj')
-rw-r--r--pjlib/src/pj/os_core_unix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c
index 8ec0cdb7..1a9fedd0 100644
--- a/pjlib/src/pj/os_core_unix.c
+++ b/pjlib/src/pj/os_core_unix.c
@@ -717,6 +717,9 @@ PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *p)
PJ_CHECK_STACK();
+ if (p == pj_thread_this())
+ return PJ_ECANCELLED;
+
PJ_LOG(6, (pj_thread_this()->obj_name, "Joining thread %s", p->obj_name));
result = pthread_join( rec->thread, &ret);