Advertisement
Guest User

RCU dependency chain 2

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