summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2019-07-03 06:55:51 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2019-07-03 06:55:51 +0000
commit3f3f3a88f222e096f34e750a99337e1c490b7e34 (patch)
tree882ac41c165898980c8705ad4a69ebc7b6a86864
parent6ae440b73cb0efc7be2dd47278294140c67fa59f (diff)
downloadlibapr-3f3f3a88f222e096f34e750a99337e1c490b7e34.tar.gz
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
-rw-r--r--CHANGES2
-rw-r--r--include/apr_thread_proc.h6
-rw-r--r--threadproc/beos/thread.c4
-rw-r--r--threadproc/netware/thread.c4
-rw-r--r--threadproc/os2/thread.c3
-rw-r--r--threadproc/unix/thread.c5
-rw-r--r--threadproc/win32/thread.c4
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,