Hello,
let's look for the following piece of code:

int x;
volatile boolean v; // v = false by default
T1:  
    x = 1;       (1)
    v = true;    (2)
    doSth        (3) 

T2:  
   doSth2        (4)   
   if (v) {}     (5)
      
   
When T2 observes that v == false in (5), does it mean that there is a 
happens-before relation (4) -> (5) -> (2) -> (3)?

What if v would be AtomicBolean?

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/mechanical-sympathy/faf3e288-f249-4d07-830b-7752bb41a472n%40googlegroups.com.

Reply via email to