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

POSIX 에 준하는 뮤텍스 API set 을 정의한다. More...

Collaboration diagram for POSIX 뮤텍스:

Data Structures

struct  pthread_mutex
 
struct  pthread_mutexattr
 

Macros

#define PTHREAD_MUTEX_INITIALIZER   { 0, (void *)NULL }
 

Typedefs

typedef struct pthread_mutex pthread_mutex_t
 
typedef struct pthread_mutexattr pthread_mutexattr_t
 

Functions

int pthread_mutex_destroy (pthread_mutex_t *mutex)
 Mutex 를 소멸 시킨다. More...
 
int pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
 Mutex 를 초기화 한다. More...
 
int pthread_mutex_lock (pthread_mutex_t *mutex)
 뮤텍스 락을 건다. More...
 
int pthread_mutex_trylock (pthread_mutex_t *mutex)
 뮤텍스 락을 시도한다. More...
 
int pthread_mutex_unlock (pthread_mutex_t *mutex)
 뮤텍스 락을 해제한다. More...
 

Detailed Description

POSIX 에 준하는 뮤텍스 API set 을 정의한다.

Date
2011-8-11
Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com

Macro Definition Documentation

#define PTHREAD_MUTEX_INITIALIZER   { 0, (void *)NULL }

Definition at line 24 of file pthread_mutex.h.

Typedef Documentation

Definition at line 21 of file pthread_mutex.h.

Definition at line 22 of file pthread_mutex.h.

Function Documentation

int pthread_mutex_destroy ( pthread_mutex_t mutex)

Mutex 를 소멸 시킨다.

Parameters
[in]mutex뮤텍스 객체
Returns
int 성공시 0, 실패시 -1
See Also
pthread_mutex_init()

Definition at line 10 of file pthread_mutex.c.

References lock.

Referenced by destroy_fat_cache().

Here is the caller graph for this function:

int pthread_mutex_init ( pthread_mutex_t mutex,
const pthread_mutexattr_t attr 
)

Mutex 를 초기화 한다.

Parameters
[out]mutex뮤텍스 객체
[in]attr뮤텍스 속성
Returns
int 성공시 0, 실패시 오류 값
See Also
pthread_mutex_destroy()

Definition at line 17 of file pthread_mutex.c.

References lock, NULL, owner, and refcnt.

Referenced by create_fat_cache().

Here is the caller graph for this function:

int pthread_mutex_lock ( pthread_mutex_t mutex)

뮤텍스 락을 건다.

Parameters
[in]mutex뮤텍스 객체
Returns
int 성공시 0, 실패시 오류 값

Definition at line 26 of file pthread_mutex.c.

References irq_local_restore(), irq_local_save(), lock, owner, pthread_equal(), pthread_self(), and refcnt.

Referenced by fat_cache_lock(), fdc_close(), fdc_ioctl(), fdc_lseek(), fdc_open(), fdc_read(), fdc_write(), page_frame_alloc(), page_frame_free(), page_frame_manage(), page_frame_ref(), and page_frame_refcnt().

Here is the call graph for this function:

Here is the caller graph for this function:

int pthread_mutex_trylock ( pthread_mutex_t mutex)

뮤텍스 락을 시도한다.

Parameters
[in]mutex뮤텍스 객체
Returns
int 성공시 0, 실패시 오류 값

Definition at line 56 of file pthread_mutex.c.

References irq_local_restore(), irq_local_save(), lock, owner, pthread_equal(), pthread_self(), and refcnt.

Here is the call graph for this function:

int pthread_mutex_unlock ( pthread_mutex_t mutex)

뮤텍스 락을 해제한다.

Parameters
[in]mutex뮤텍스 객체
Returns
int 성공시 0, 실패시 오류 값

Definition at line 93 of file pthread_mutex.c.

References EINVAL, irq_local_restore(), irq_local_save(), lock, NULL, owner, pthread_equal(), pthread_self(), and refcnt.

Referenced by fat_cache_unlock(), fdc_close(), fdc_ioctl(), fdc_lseek(), fdc_open(), fdc_read(), fdc_write(), page_frame_alloc(), page_frame_free(), page_frame_manage(), page_frame_ref(), and page_frame_refcnt().

Here is the call graph for this function:

Here is the caller graph for this function: