pthread_rwlock_timedrdlock(3p) - wariua/manpages-ko GitHub Wiki
μ΄ λ§€λ΄μΌ νμ΄μ§λ POSIX νλ‘κ·Έλλ¨Έ λ§€λ΄μΌμ μΌλΆμ΄λ€. μ΄ μΈν°νμ΄μ€μ 리λ μ€ κ΅¬νμ μ°¨μ΄κ° μμ μ μμΌλ©° (μμΈν 리λ μ€ λμ λ°©μμ ν΄λΉ 리λ μ€ λ§€λ΄μΌ νμ΄μ§ μ°Έκ³ ) 리λ μ€μμ μ΄ μΈν°νμ΄μ€κ° ꡬνλμ΄ μμ§ μμ μλ μλ€.
pthread_rwlock_timedrdlock - μ½κΈ°-μ°κΈ° λ½μ μ½κΈ°μ©μΌλ‘ μ κ·ΈκΈ°
#include <pthread.h>
#include <time.h>
int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict rwlock,
const struct timespec *restrict abstime);
pthread_rwlock_timedrdlock()
ν¨μλ pthread_rwlock_rdlock()
ν¨μμμμ²λΌ rwlock
μ΄ κ°λ¦¬ν€λ λ½μ μ½κΈ° λ½μ μ μ©νλ€. νμ§λ§ λ€λ₯Έ μ€λ λκ° λ½μ νΈλ κ±Έ κΈ°λ€λ¦¬μ§ μκ³ λ λ½μ νλν μ μλ κ²½μ°μ μ§μ ν νμμμ λ§λ£ μ κ·Έ λκΈ°λ₯Ό λλΈλ€. νμμμ κΈ°μ€ ν΄λμΌλ‘ μΈ‘μ ν΄μ abstime
μΌλ‘ μ§μ ν μ λ μκ°μ΄ μ§λ λ (μ¦ κ·Έ ν΄λμ κ°μ΄ abstime
κ³Ό κ°κ±°λ κ·Έλ³΄λ€ μ»€μ§ λ), λλ abstime
μΌλ‘ μ§μ ν μ λ μκ°μ΄ νΈμΆ μμ μ μ΄λ―Έ μ§λ μλ κ²½μ°μ νμμμμ΄ λ§λ£λλ€.
νμμμμ CLOCK_REALTIME
ν΄λμ κΈ°μ€μΌλ‘ νλ€. νμμμμ ν΄μλλ CLOCK_REALTIME
ν΄λμ ν΄μλμ΄λ€. <time.h>
ν€λμ timespec
λ°μ΄ν° νμ
μ΄ μ μλμ΄ μλ€. λ½μ μ¦μ νλν μ μμΌλ©΄ μ΄λ€ κ²½μ°μλ νμμμ λλ¬Έμ ν¨μκ° μ€ν¨νμ§ μλλ€. λ½μ μ¦μ νλν μ μλ€λ©΄ abstime
λ§€κ°λ³μμ μ ν¨μ±μ κ²μ¬ν νμκ° μλ€.
pthread_rwlock_timedrdlock()
νΈμΆμ ν΅ν΄ μ½κΈ°-μ°κΈ° λ½μ λΈλ‘ μ€μΈ μ€λ λμκ² μκ·Έλ νΈλ€λ¬ μ€νμ μ λ°νλ μκ·Έλμ΄ μ λ¬λλ κ²½μ° μκ·Έλ νΈλ€λ¬μμ λ°νν μ€λ λκ° μ€λ¨λ μ μλ κ²μ²λΌ λ€μ λ½μ λκΈ°νλ€.
νΈμΆμ΄ μ΄λ€μ§λ μμ μ νΈμΆ μ°λ λκ° rwlock
μ μ°κΈ° λ½μ μ‘κ³ μλ€λ©΄ κ΅μ°©μ΄ μΌμ΄λ μλ μλ€. μ΄κΈ°ν μ λ μ½κΈ°-μ°κΈ° λ½μΌλ‘ μ΄ ν¨μλ₯Ό νΈμΆνλ κ²½μ°μ κ²°κ³Όλ κ·μ λμ΄ μμ§ μλ€.
pthread_rwlock_timedrdlock()
ν¨μλ rwlock
μ΄ κ°λ¦¬ν€λ μ½κΈ°-μ°κΈ° λ½ κ°μ²΄μμ μ½κΈ°μ© λ½μ νλν κ²½μ° 0μ λ°ννλ€. μλλ©΄ μ€λ₯λ₯Ό λνλ΄λ μ€λ₯ λ²νΈλ₯Ό λ°ννλ€.
λ€μ κ²½μ°μ pthread_rwlock_timedrdlock()
ν¨μκ° μ€ν¨νλ€.
ETIMEDOUT
- μ§μ ν νμμμ λ§λ£ μ μ λ½μ νλν μ μμλ€.
λ€μ κ²½μ°μ pthread_rwlock_timedrdlock()
ν¨μκ° μ€ν¨ν μλ μλ€.
EAGAIN
- λ½μ λν μ½κΈ° λ½ μ΅λ νμλ₯Ό μ΄κ³ΌνκΈ° λλ¬Έμ μ½κΈ° λ½μ νλν μ μλ€.
EDEADLK
- κ΅μ°© 쑰건μ νμ§νκ±°λ νΈμΆ μ€λ λκ° μ΄λ―Έ
rwlock
μ μ°κΈ° λ½μ μ‘κ³ μλ€. EINVAL
-
abstime
μ λλ Έμ΄ κ°μ΄ 0λ³΄λ€ μκ±°λ 10μ΅ μ΄μμ΄λ€.
μ΄ ν¨μλ μ€λ₯ μ½λ [EINTR]
μ λ°ννμ§ μλλ€.
μ΄νλ κ·λ²μ μ΄μ§ μμ λ΄μ©μ΄λ€.
μμ.
μ΄ ν¨μλ₯Ό μ°λ μμ©μμ POSIX.1-2008 Base Definitions κΆμ 3.287μ Priority Inversionμμ λ Όμνλ μ°μ μμ μμ μ κ²ͺμ μ μλ€.
pthread_rwlock_timedrdlock()
μ rwlock
μΈμλ‘ μ§μ ν κ°μ΄ μ΄κΈ°ν λ μ½κΈ°-μ°κΈ° λ½ κ°μ²΄λ₯Ό κ°λ¦¬ν€κ³ μμ§ μμμ ꡬνμμ κ°μ§νλ κ²½μ° ν¨μλ₯Ό μ€ν¨ μ²λ¦¬νκ³ [EINVAL]
μ€λ₯λ₯Ό λ³΄κ³ νκΈ°λ₯Ό κΆμ₯νλ€.
μμ.
pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock()
POSIX.1-2008 Base Definitions κΆ, 3.287μ Priority Inversion, 4.11μ Memory Synchronization, <pthread.h>
, <time.h>
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
2013