Skip to content

Commit

Permalink
kernel: thread: move thread states to header
Browse files Browse the repository at this point in the history
Move state string defines into thread header.

Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Apr 1, 2024
1 parent f5435b3 commit 8a88cd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 10 additions & 0 deletions kernel/include/kthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
#include <kernel_internal.h>
#include <timeout_q.h>


#define Z_STATE_STR_DUMMY "dummy"
#define Z_STATE_STR_PENDING "pending"
#define Z_STATE_STR_PRESTART "prestart"
#define Z_STATE_STR_DEAD "dead"
#define Z_STATE_STR_SUSPENDED "suspended"
#define Z_STATE_STR_ABORTING "aborting"
#define Z_STATE_STR_SUSPENDING "suspending"
#define Z_STATE_STR_QUEUED "queued"

#ifdef CONFIG_THREAD_MONITOR
/* This lock protects the linked list of active threads; i.e. the
* initial _kernel.threads pointer and the linked list made up of
Expand Down
9 changes: 0 additions & 9 deletions kernel/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,6 @@ static size_t copy_bytes(char *dest, size_t dest_size, const char *src, size_t s
return bytes_to_copy;
}

#define Z_STATE_STR_DUMMY "dummy"
#define Z_STATE_STR_PENDING "pending"
#define Z_STATE_STR_PRESTART "prestart"
#define Z_STATE_STR_DEAD "dead"
#define Z_STATE_STR_SUSPENDED "suspended"
#define Z_STATE_STR_ABORTING "aborting"
#define Z_STATE_STR_SUSPENDING "suspending"
#define Z_STATE_STR_QUEUED "queued"

const char *k_thread_state_str(k_tid_t thread_id, char *buf, size_t buf_size)
{
size_t off = 0;
Expand Down

0 comments on commit 8a88cd4

Please sign in to comment.