pthread_rwlock t1;
pthread_rwlock_wrlock(&t1);
pthread_rwlock t2 = t1;
what happend?
is t2 locked or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Nothing special happens.
pthread_rwlock_t(notpthread_rwlock, AFAIK) is an opaque C struct. Copying the variable simply copies the struct, byte for byte.At the Pthreads level, copying a
pthread_rwlock_tresults in undefined behaviour. Don’t do it.