From 1748ad5db71f7bf0e4d32a3afb3293967946f468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 Mar 2004 17:40:14 +0000 Subject: [PATCH] Added find_thread() (does not yet work with name != NULL). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6860 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/thread.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c index f1cd7d69b4..5f63e89c23 100644 --- a/src/kernel/core/thread.c +++ b/src/kernel/core/thread.c @@ -1370,6 +1370,18 @@ err: } +thread_id +find_thread(const char *name) +{ + if (name == NULL) + return thread_get_current_thread_id(); + + // ToDo: implement me! + + return B_ENTRY_NOT_FOUND; +} + + status_t set_thread_priority(thread_id id, int32 priority) { @@ -1651,6 +1663,19 @@ user_get_next_thread_info(team_id team, int32 *userCookie, thread_info *userInfo } +thread_id +_user_find_thread(const char *userName) +{ + char name[B_OS_NAME_LENGTH]; + + if (!IS_USER_ADDRESS(userName) + || user_strlcpy(name, userName, sizeof(name)) < B_OK) + return B_BAD_ADDRESS; + + return find_thread(name); +} + + status_t user_wait_for_thread(thread_id id, status_t *userReturnCode) {