Commit 4357fb57 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Make bugginess of code sample more evident

One of the code samples in whatisRCU.txt shows a bug, but someone scanning
the document quickly might mistake it for a valid use of RCU.  Add some
screaming comments to help keep speed-readers on track.
Reported-by: default avatarNathan Zimmer <nzimmer@sgi.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f6161aa1
...@@ -265,9 +265,9 @@ rcu_dereference() ...@@ -265,9 +265,9 @@ rcu_dereference()
rcu_read_lock(); rcu_read_lock();
p = rcu_dereference(head.next); p = rcu_dereference(head.next);
rcu_read_unlock(); rcu_read_unlock();
x = p->address; x = p->address; /* BUG!!! */
rcu_read_lock(); rcu_read_lock();
y = p->data; y = p->data; /* BUG!!! */
rcu_read_unlock(); rcu_read_unlock();
Holding a reference from one RCU read-side critical section Holding a reference from one RCU read-side critical section
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment