|
From: kosmirror <kos...@us...> - 2025-10-19 05:01:07
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 86a2f34e0a5fe1e5ae877f766505aa70e614d1a4 (commit)
from 7bf0e0329b23482eae9f5231f39a0843dee407c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 86a2f34e0a5fe1e5ae877f766505aa70e614d1a4
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 21:42:15 2025 -0400
thread: Constify accessor params.
None modify the contents of what is being accessed.
Note that `thd_get_cpu_time` doesn't qualify as it
will attempt to update the time if being called on
the current thread. Neither do `thd_get_errno` or
`thd_get_reent` as the return would discard the
qualifier.
-----------------------------------------------------------------------
Summary of changes:
include/kos/thread.h | 8 ++++----
kernel/thread/thread.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/kos/thread.h b/include/kos/thread.h
index e0b8f9c6..b0124e9e 100644
--- a/include/kos/thread.h
+++ b/include/kos/thread.h
@@ -531,7 +531,7 @@ int thd_set_prio(kthread_t *thd, prio_t prio);
\sa thd_set_prio
*/
-prio_t thd_get_prio(kthread_t *thd);
+prio_t thd_get_prio(const kthread_t *thd);
/** \brief Retrieve a thread's numeric identifier.
\relatesalso kthread_t
@@ -541,7 +541,7 @@ prio_t thd_get_prio(kthread_t *thd);
\return The identifier of the thread
*/
-tid_t thd_get_id(kthread_t *thd);
+tid_t thd_get_id(const kthread_t *thd);
/** \brief Retrieve the current thread's kthread struct.
\relatesalso kthread_t
@@ -559,7 +559,7 @@ kthread_t *thd_get_current(void);
\sa thd_set_label
*/
-const char *thd_get_label(kthread_t *thd);
+const char *thd_get_label(const kthread_t *thd);
/** \brief Set the thread's label.
\relatesalso kthread_t
@@ -590,7 +590,7 @@ void thd_set_label(kthread_t *__RESTRICT thd, const char *__RESTRICT label);
\sa thd_set_pd
*/
-const char *thd_get_pwd(kthread_t *thd);
+const char *thd_get_pwd(const kthread_t *thd);
/** \brief Set the thread's current working directory.
\relatesalso kthread_t
diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c
index 743d0cf2..aeccf3a1 100644
--- a/kernel/thread/thread.c
+++ b/kernel/thread/thread.c
@@ -568,14 +568,14 @@ int thd_set_prio(kthread_t *thd, prio_t prio) {
return 0;
}
-prio_t thd_get_prio(kthread_t *thd) {
+prio_t thd_get_prio(const kthread_t *thd) {
if(!thd)
thd = thd_current;
return thd->prio;
}
-tid_t thd_get_id(kthread_t *thd) {
+tid_t thd_get_id(const kthread_t *thd) {
if(!thd)
thd = thd_current;
@@ -873,7 +873,7 @@ int thd_detach(kthread_t *thd) {
/*****************************************************************************/
/* Retrieve / set thread label */
-const char *thd_get_label(kthread_t *thd) {
+const char *thd_get_label(const kthread_t *thd) {
if(!thd)
thd = thd_current;
@@ -893,7 +893,7 @@ kthread_t *thd_get_current(void) {
}
/* Retrieve / set thread pwd */
-const char *thd_get_pwd(kthread_t *thd) {
+const char *thd_get_pwd(const kthread_t *thd) {
if(!thd)
thd = thd_current;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|