diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-01-22 19:10:17 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-01-22 19:10:17 +0000 |
commit | 06b85d75ffb639032a22802bbe8914c70d48fb03 (patch) | |
tree | b165ddb86b32d14d8a2a0ecbe1c764d4096b88fe /pjlib/src/pj/os_core_unix.c | |
parent | 5d7fc1ab44dd43d9170119bafbd2fc54c0829a8c (diff) |
Give more useful information when assertion fails in pj_thread_this()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@896 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_core_unix.c')
-rw-r--r-- | pjlib/src/pj/os_core_unix.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c index 4ebdedeb..59b60b0f 100644 --- a/pjlib/src/pj/os_core_unix.c +++ b/pjlib/src/pj/os_core_unix.c @@ -507,7 +507,12 @@ PJ_DEF(pj_thread_t*) pj_thread_this(void) { #if PJ_HAS_THREADS pj_thread_t *rec = pj_thread_local_get(thread_tls_id); - pj_assert(rec != NULL); + + if (rec == NULL) { + pj_assert(!"Calling pjlib from unknown/external thread. You must " + "register external threads with pj_thread_register() " + "before calling any pjlib functions."); + } /* * MUST NOT check stack because this function is called |