|
nckernel
0.1
|
|
Data Structures | |
| struct | timespec |
Typedefs | |
| typedef void * | sem_t |
| 세마포어 객체 More... | |
Functions | |
| void | sem_clear (struct thread *tcb) |
| int | sem_destroy (sem_t *sem) |
| 세마포어 객체를 소멸 시킨다. More... | |
| int | sem_getvalue (sem_t *sem, int *val) |
| 지정된 세마포어 객체에서 조건 값을 가져온다. More... | |
| int | sem_init (sem_t *sem, int pshared, unsigned int value) |
| 세마포어 객체를 초기화 한다. More... | |
| int | sem_post (sem_t *sem) |
| 세마포어 증가 연산을 수행한다. More... | |
| int | sem_timedwait (sem_t *sem, const struct timespec *abs_timeout) |
| 지정된 시간 안에 세마포어 감소 연산을 시도해 본다 More... | |
| int | sem_trywait (sem_t *sem) |
| 세마포어 감소 연산을 시도해 본다. More... | |
| int | sem_wait (sem_t *sem) |
| 세마포어 감소 연산을 수행한다. More... | |
세마포어를 구현한다
| typedef void* sem_t |
세마포어 객체
Definition at line 13 of file semaphore.h.
| void sem_clear | ( | struct thread * | tcb) |
Definition at line 204 of file semaphore.c.
References free(), sem::list, list_entry, list_for_each_safe, thread::sem, and sem_list_info::tcb.
Referenced by pthread_cancel().


| int sem_destroy | ( | sem_t * | sem) |
세마포어 객체를 소멸 시킨다.
| [in] | sem | 세마포어 객체 |
Definition at line 52 of file semaphore.c.
References assert, EINVAL, free(), sem_list_info::head, sem::list, list_entry, list_for_each_safe, NULL, thread::sem, and sem_list_info::tcb.

| int sem_getvalue | ( | sem_t * | sem, |
| int * | val | ||
| ) |
지정된 세마포어 객체에서 조건 값을 가져온다.
| [in] | sem | 세마포어 객체 |
| [in] | val | 조건 값 |
Definition at line 186 of file semaphore.c.
References assert, EINVAL, and sem::value.
| int sem_init | ( | sem_t * | sem, |
| int | pshared, | ||
| unsigned int | value | ||
| ) |
세마포어 객체를 초기화 한다.
| [in] | sem | 세마포어 객체 |
| [in] | pshared | 0 이면 쓰레드 공유, 0 이 아니면 프로세스 공유 |
| [in] | value | 세마포어 초기 값 |
Definition at line 33 of file semaphore.c.
References assert, ENOMEM, sem::list, malloc(), sem::pshared, and sem::value.

| int sem_post | ( | sem_t * | sem) |
세마포어 증가 연산을 수행한다.
| [in] | sem | 세마포어 객체 |
Definition at line 80 of file semaphore.c.
References assert, EINVAL, free(), sem_list_info::head, irq_local_restore(), irq_local_save(), sem::list, list_entry, LIST_NEXT, NULL, thread::sem, sem_list_info::tcb, and sem::value.

지정된 시간 안에 세마포어 감소 연산을 시도해 본다
| [in] | sem | 세마포어 객체 |
| [in] | abs_timeout | 기다릴 시간 |
Definition at line 173 of file semaphore.c.
| int sem_trywait | ( | sem_t * | sem) |
세마포어 감소 연산을 시도해 본다.
| [in] | sem | 세마포어 객체 |
Definition at line 152 of file semaphore.c.
References assert, EBUSY, EINVAL, irq_local_restore(), irq_local_save(), and sem::value.

| int sem_wait | ( | sem_t * | sem) |
세마포어 감소 연산을 수행한다.
| [in] | sem | 세마포어 객체 |
Definition at line 114 of file semaphore.c.
References assert, EINVAL, ENOMEM, sem_list_info::head, irq_local_restore(), irq_local_save(), sem::list, malloc(), pthread_self(), thread::sem, sem_list_info::tcb, and sem::value.
Referenced by fdc_read_deleted_sector(), fdc_read_id(), fdc_read_sector(), fdc_read_track(), fdc_seek(), fdc_verify(), fdc_write_deleted_sector(), and fdc_write_sector().


1.8.4