diff options
author | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2003-12-29 15:31:39 +0000 |
---|---|---|
committer | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2003-12-29 15:31:39 +0000 |
commit | a5a17128be90d60a7b311b4152641c279483c278 (patch) | |
tree | 6877c0620b769ebb01ff56662ca7a271991b1503 /locks | |
parent | 1f41a480cc7dace4b040ece2a05ad5838cc48c2c (diff) | |
download | libapr-a5a17128be90d60a7b311b4152641c279483c278.tar.gz |
* include/apr_thread_cond.h: Note when destroying a condvar gives
undefined results in a POSIX implementation.
* locks/unix/thread_cond.c (apr_thread_cond_create): Don't run cleanup
if pthread_cond_init fails since that gives undefined results.
(apr_thread_cond_destroy): Use apr_pool_cleanup_run so the cleanup is
always unregistered.
* test/testlock.c (test_cond): Test apr_thread_cond_destroy and use
apr_assert_success() a little more.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64848 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks')
-rw-r--r-- | locks/unix/thread_cond.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/locks/unix/thread_cond.c b/locks/unix/thread_cond.c index ae6c760cf..94f42268a 100644 --- a/locks/unix/thread_cond.c +++ b/locks/unix/thread_cond.c @@ -87,7 +87,6 @@ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, #ifdef PTHREAD_SETS_ERRNO rv = errno; #endif - thread_cond_cleanup(new_cond); return rv; } @@ -166,12 +165,7 @@ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond) APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond) { - apr_status_t rv; - if ((rv = thread_cond_cleanup(cond)) == APR_SUCCESS) { - apr_pool_cleanup_kill(cond->pool, cond, thread_cond_cleanup); - return APR_SUCCESS; - } - return rv; + return apr_pool_cleanup_run(cond->pool, cond, thread_cond_cleanup); } APR_POOL_IMPLEMENT_ACCESSOR(thread_cond) |