pthread_mutex_consistent(3) - wariua/manpages-ko GitHub Wiki
pthread_mutex_consistent - ๊ฒฌ๊ณ ๋ฎคํ ์ค๋ฅผ ์ผ๊ด์ ์ํ๋ก ๋ง๋ค๊ธฐ
#include <pthread.h>
int pthread_mutex_consistent(pthread_mutex_t *mutex);
-pthread
๋ก ์ปดํ์ผ ๋ฐ ๋งํฌ.
glibc ๊ธฐ๋ฅ ํ์ธ ๋งคํฌ๋ก ์๊ฑด (feature_test_macros(7) ์ฐธ๊ณ ):
-
pthread_mutex_consistent()
: _POSIX_C_SOURCE >= 200809L
์ด ํจ์๋ ๊ฒฌ๊ณ ๋ฎคํ
์ค๊ฐ ๋น์ผ๊ด ์ํ์ด๋ฉด ์ ์ ์ํ๋ก ๋ง๋ ๋ค. ์์ ์๊ฐ ๋ฎคํ
์ค๋ฅผ ์ก์ ์ฑ ์ข
๋ฃํ๋ฉด ๋ฎคํ
์ค๊ฐ ๋น์ผ๊ด ์ํ๋ก ๋จ์ ์ ์๋๋ฐ, ๊ทธ ๊ฒฝ์ฐ์ ๊ทธ ๋ฎคํ
์ค๋ฅผ ํ๋ํ๋ ๋ค์ ์์ ์๋ pthread_mutex_lock()
ํธ์ถ์ ์ฑ๊ณตํ๋ฉด์ EOWNERDEAD
๋ฐํ ๊ฐ์ผ๋ก ์๋ฆผ์ ๋ฐ๊ฒ ๋๋ค.
์ฑ๊ณต ์ pthread_mutex_consistent()
๋ 0์ ๋ฐํํ๋ค. ์๋๋ฉด ์ค๋ฅ ์์ธ์ ๋ํ๋ด๋ ์์ ์ค๋ฅ ๋ฒํธ๋ฅผ ๋ฐํํ๋ค.
EINVAL
- ๋ฎคํ ์ค๊ฐ ๊ฒฌ๊ณ ๊ฐ ์๋๊ฑฐ๋ ๋น์ผ๊ด ์ํ๊ฐ ์๋๋ค.
glibc ๋ฒ์ 2.12์์ pthread_mutex_consistent()
๊ฐ ์ถ๊ฐ๋์๋ค.
POSIX.1-2008.
pthread_mutex_consistent()
๋ ๋ฎคํ
์ค๊ฐ ๋ณดํธํ๋ ์ํ(๊ณต์ ๋ฐ์ดํฐ)๊ฐ ์ ์ ์ํ๋ก ๋ณต๊ตฌ๋์๊ณ ์ด์ ๊ทธ ๋ฎคํ
์ค๋ก ์ ์์ ์ธ ๋์์ ์ํํ ์ ์๋ค๋ ๊ฒ์ ๊ตฌํ์๊ฒ ์๋ฆด ๋ฟ์ด๋ค. pthread_mutex_consistent()
๋ฅผ ํธ์ถํ๊ธฐ ์ ์ ๊ณต์ ๋ฐ์ดํฐ๋ฅผ ์ ์ ์ํ๋ก ๋ณต๊ตฌํ๋ ๊ฒ์ ์์ฉ์ ์ฑ
์์ด๋ค.
POSIX์ pthread_mutex_consistent()
๊ฐ ์ถ๊ฐ๋๊ธฐ ์ ์ glibc์์๋ _GNU_SOURCE
๊ฐ ์ ์๋ ๊ฒฝ์ฐ ๋๋ฑํ ๋ค์ ๋นํ์ค ํจ์๋ฅผ ์ ์ํ์๋ค.
int pthread_mutex_consistent_np(const pthread_mutex_t *mutex);
์ด GNU ์ ์ฉ API๋ glibc 2.4์์ ์ฒ์ ๋ฑ์ฅํ์ผ๋ฉฐ, ํ์ฌ๋ ๊ตฌ์์ด ๋์์ผ๋ฏ๋ก ์ ํ๋ก๊ทธ๋จ์์ ์ฐ์ง ๋ง์์ผ ํ๋ค.
pthread_mutexattr_setrobust(3) ์ฐธ๊ณ .
pthread_mutexattr_init(3), pthread_mutex_lock(3), pthread_mutexattr_setrobust(3), pthread_mutexattr_getrobust(3), pthreads(7)
2017-08-20