Files
PluralTechnology/service/ptos/head/ps/thread.h
T
2026-07-14 15:54:23 -04:00

44 lines
843 B
C

/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: Thread management
* Author: Chloe M.
*/
#ifndef _PS_THREAD_H_
#define _PS_THREAD_H_ 1
#include <ptapi/status.h>
#include <ptdef.h>
#include <queue.h>
#define THREAD_POOL_TAG 'TD'
struct _PROCESS;
/*
* Represents a runnable thread that exists within
* processes.
*
* @Tid: Thread ID
* @Parent: Parent process
* @ThreadLink: Thread queue link
*/
typedef struct _THREAD {
UQUAD Tid;
struct _PROCESS *Parent;
TAILQ_ENTRY(_THREAD) ThreadLink;
} THREAD;
/*
* Create a new thread
*
* @Parent: Parent of thread to create
* @Flags: Optional init flags
* @Result: Result is written here
*/
PT_STATUS PsCreateThread(struct _PROCESS *Parent, ULONG Flags, THREAD **Result);
#endif /* !_PS_THREAD_H_ */