Skip to content

Instantly share code, notes, and snippets.

@IshJ
Created September 8, 2016 18:01
Show Gist options
  • Save IshJ/423e97e1c28d8fa9553eb71e47904478 to your computer and use it in GitHub Desktop.
Save IshJ/423e97e1c28d8fa9553eb71e47904478 to your computer and use it in GitHub Desktop.
threadOperation(){
.
.
.
if(memberFunction){
pthread_rwlock_rdlock(&rwlock);
Member(random_value, head);
pthread_rwlock_unlock(&rwlock);
}
if(insertFunction){
pthread_rwlock_wrlock(&rwlock);
Insert(random_value, &head);
pthread_rwlock_unlock(&rwlock);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment