ggubuk97 / apue

advanced programming in the unix environment study
0 stars 2 forks source link

#ch12 #7

Open ggubuk97 opened 9 years ago

ggubuk97 commented 9 years ago

process 사이의 mutex 공유 설정에 대한 함수입니다.

#include <pthread.h>
int pthread_mutexattr_getpshared(const pthread_mutexattr_t * restrict attr, int *restrict pshared);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);

다음 page에 예제가 잘 나와 있네요. https://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/apis/users_57.htm

process간에 mutex를 share하는 "PTHREAD_PROCESS_SHARED", default는 "PTHREAD_PROCESS_PRIVATE"