From 3f3f3a88f222e096f34e750a99337e1c490b7e34 Mon Sep 17 00:00:00 2001 From: jorton Date: Wed, 3 Jul 2019 06:55:51 +0000 Subject: API/ABI change, drop return value of apr_thread_exit() which has no useful (nor documented) semantic: * include/apr_thread_proc.h (apr_thread_exit): Make void function; mark with gcc noreturn attribute. * threadproc/*/thread.c (apr_thread_exit): Update accordingly. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1862446 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ include/apr_thread_proc.h | 6 +++--- threadproc/beos/thread.c | 4 +--- threadproc/netware/thread.c | 4 +--- threadproc/os2/thread.c | 3 +-- threadproc/unix/thread.c | 5 ++--- threadproc/win32/thread.c | 4 +--- 7 files changed, 11 insertions(+), 17 deletions(-) diff --git a/CHANGES b/CHANGES index 0e181364d..a3711f840 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 2.0.0 + *) apr_thread_exit() is now a void function. [Joe Orton] + *) apr_dir_read(): The returned finfo->name field is now duplicated into the pool for all implementations. [Joe Orton] diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index 362ad2c1c..b1bd01533 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -270,12 +270,12 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, void *data, apr_pool_t *cont); /** - * stop the current thread + * Stop the current thread * @param thd The thread to stop * @param retval The return value to pass back to any thread that cares */ -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t retval); +APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) + __attribute__((noreturn)); /** * block until the desired thread stops executing. diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 01bc7a973..c372f135e 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -124,13 +124,11 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) return tid1 == tid2; } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) +APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { apr_pool_destroy(thd->pool); thd->exitval = retval; exit_thread ((status_t)(retval)); - /* This will never be reached... */ - return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd) diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index a37b107a0..bf0396395 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -159,13 +159,11 @@ void apr_thread_yield() NXThreadYield(); } -apr_status_t apr_thread_exit(apr_thread_t *thd, - apr_status_t retval) +void apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; apr_pool_destroy(thd->pool); NXThreadExit(NULL); - return APR_SUCCESS; } apr_status_t apr_thread_join(apr_status_t *retval, diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 9911034ae..8781f932a 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -131,12 +131,11 @@ APR_DECLARE(apr_os_thread_t) apr_os_thread_current() -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) +APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; apr_pool_destroy(thd->pool); _endthread(); - return -1; /* If we get here something's wrong */ } diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index dcef500e9..f76e6ce44 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -204,13 +204,12 @@ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, return pthread_equal(tid1, tid2); } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t retval) +APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, + apr_status_t retval) { thd->exitval = retval; apr_pool_destroy(thd->pool); pthread_exit(NULL); - return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c index 3204a1c2c..aa045df39 100644 --- a/threadproc/win32/thread.c +++ b/threadproc/win32/thread.c @@ -134,8 +134,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, return APR_SUCCESS; } -APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, - apr_status_t retval) +APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval) { thd->exitval = retval; apr_pool_destroy(thd->pool); @@ -145,7 +144,6 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, #else ExitThread(0); #endif - return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, -- cgit v1.2.1