Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 /* How about this? */
- 2 int lookup2(int key)
- 3 {
- 4 struct foo *p;
- 5 int data;
- 6
- 7 rcu_read_lock();
- 8 p = rcu_dereference(gp);
- 9 if (p != NULL && p->key == key)
- 10 data = p->data;
- 11 else
- 12 data = -1;
- 13 rcu_read_unlock();
- 14 return data;
- 15 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement