nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions

쓰레드의 현재 상태를 설정한다. More...

#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include <object.h>
#include <list.h>
#include <thread.h>
#include <vfs.h>
#include <debug.h>
#include <common.h>
#include <interrupt.h>
Include dependency graph for thread.c:

Go to the source code of this file.

Macros

#define THREAD_IS_ROOT(tcb)   ((tcb)->parent == NULL && (tcb)->root == (tcb))
 
#define THREAD_LIST_INIT(tcb)
 
#define THREAD_LIST_LINK(tcb)
 

Functions

int thread_create (struct thread *tcb, struct thread_attr *attr)
 
void * thread_get_arch_data (struct thread *tcb)
 
unsigned long thread_get_stack_pointer (struct thread *tcb)
 
int thread_get_status (struct thread *tcb)
 
FILEthread_get_stderr (void)
 현재 쓰레드의 표준 에러 출력을 가져 온다. More...
 
FILEthread_get_stdin (void)
 현재 쓰레드의 표준 입력을 가져온다. return FILE * More...
 
FILEthread_get_stdout (void)
 현재 쓰레드의 표준 출력을 가져온다. More...
 
void * thread_get_user_data (struct thread *tcb)
 
void thread_set_status (struct thread *tcb, int status)
 

Detailed Description

쓰레드의 현재 상태를 설정한다.

쓰레드 콘트롤 블럭에서 추가 관리 정보를 얻어 온다.

쓰레드 콘트롤 블럭에서 아키텍쳐 연관 정보를 얻어 온다.

해당 쓰레드의 최초 스택 포인터 값을 가져온다.

쓰레드의 현재 상태를 가져온다.

Parameters
[in]tcb
[in]attr
Returns
int
Parameters
[in]tcb쓰레드 콘트롤 블럭
[in]status쓰레드 상태
Returns
void 없음
Parameters
[in]tcb쓰레드 콘트롤 블럭
Returns
int 현재 쓰레드 상태
Parameters
[in]tcb쓰레드 콘트롤 블럭
Returns
unsigned long 스택 포인터
Parameters
[in]tcb쓰레드 콘트롤 블럭
Returns
void * 아키텍쳐 정보에 대한 포인터
Parameters
[in]tcb쓰레드 콘트롤 블럭
Returns
void * 추가 관리 정보에 대한 포인터

Definition in file thread.c.

Macro Definition Documentation

#define THREAD_IS_ROOT (   tcb)    ((tcb)->parent == NULL && (tcb)->root == (tcb))

Definition at line 43 of file thread.c.

#define THREAD_LIST_INIT (   tcb)
Value:
do { \
INIT_LIST_HEAD(&(tcb)->sibling); \
INIT_LIST_HEAD(&(tcb)->child); \
INIT_LIST_HEAD(&(tcb)->link); \
} while (0)

Definition at line 45 of file thread.c.

#define THREAD_LIST_LINK (   tcb)
Value:
do { \
unsigned long flag; \
struct thread *first_child; \
irq_local_save(&flag); \
INIT_LIST_HEAD(&(tcb)->child); \
INIT_LIST_HEAD(&(tcb)->sibling); \
\
first_child = list_entry(tcb->parent->child.next, struct thread, child); \
if (first_child) { \
list_add_tail(&tcb->sibling, &first_child->sibling); \
} else { \
list_add_tail(&tcb->child, &tcb->parent->child); \
} \
\
list_add_tail(&(tcb)->link, &(tcb)->root->link); \
irq_local_restore(flag); \
} while (0)

Definition at line 23 of file thread.c.