]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - Documentation/memory-barriers.txt
Merge remote-tracking branch 'parisc-hd/for-next'
[karo-tx-linux.git] / Documentation / memory-barriers.txt
index fa5d8a9ae2051184ddba6ce3d1dd769414d2e59f..c8c42e64e953b4cd47d23da125ac5e057d1c158d 100644 (file)
@@ -531,9 +531,10 @@ dependency barrier to make it work correctly.  Consider the following bit of
 code:
 
        q = &a;
-       if (p)
+       if (p) {
+               <data dependency barrier>
                q = &b;
-       <data dependency barrier>
+       }
        x = *q;
 
 This will not have the desired effect because there is no actual data
@@ -542,9 +543,10 @@ attempting to predict the outcome in advance.  In such a case what's actually
 required is:
 
        q = &a;
-       if (p)
+       if (p) {
+               <read barrier>
                q = &b;
-       <read barrier>
+       }
        x = *q;