diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-22 19:08:19 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-22 19:08:19 +0000 |
commit | a6ab2ff2d65de77f7953aaab59f9d47c3de52e7a (patch) | |
tree | a3ae441e698d45dbc8febf0bf869132bbc8d72ab /pjlib/src/pjlib-test/thread.c | |
parent | fde4e788d7e947a2f91583041d3ce0de97ad2d6a (diff) |
Added a little more threading test and put more info in ioqueue test log
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@351 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pjlib-test/thread.c')
-rw-r--r-- | pjlib/src/pjlib-test/thread.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pjlib/src/pjlib-test/thread.c b/pjlib/src/pjlib-test/thread.c index 2c7c41f7..72cb2ecd 100644 --- a/pjlib/src/pjlib-test/thread.c +++ b/pjlib/src/pjlib-test/thread.c @@ -125,7 +125,16 @@ static int simple_thread(const char *title, unsigned flags) return -1010; } + pj_thread_sleep(500); + if (flags & PJ_THREAD_SUSPENDED) { + + /* Check that counter is still zero */ + if (counter != 0) { + PJ_LOG(3,(THIS_FILE, "...error: thread is not suspended")); + return -1015; + } + rc = pj_thread_resume(thread); if (rc != PJ_SUCCESS) { app_perror("...error: resume thread error", rc); @@ -135,11 +144,18 @@ static int simple_thread(const char *title, unsigned flags) PJ_LOG(3,(THIS_FILE, "..waiting for thread to quit..")); + pj_thread_sleep(500); + quit_flag = 1; pj_thread_join(thread); pj_pool_release(pool); + if (counter == 0) { + PJ_LOG(3,(THIS_FILE, "...error: thread is not running")); + return -1025; + } + PJ_LOG(3,(THIS_FILE, "...%s success", title)); return PJ_SUCCESS; } |