06.08.2013 Views

Threads in the new ISO C Standard from 2011

Threads in the new ISO C Standard from 2011

Threads in the new ISO C Standard from 2011

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Atomic Compare and Exchange Function Prototypes<br />

bool atomic_compare_exchange_strong_explicit(<br />

volatile A* ptr,<br />

C* expected,<br />

C value,<br />

memory_order success,<br />

memory_order failure);<br />

bool atomic_compare_exchange_weak_explicit(<br />

volatile A* ptr,<br />

C* expected,<br />

C value,<br />

memory_order success,<br />

memory_order failure);<br />

bool atomic_compare_exchange_strong(<br />

volatile A* ptr,<br />

C* expected,<br />

C value);<br />

bool atomic_compare_exchange_weak(<br />

volatile A* ptr,<br />

C* expected,<br />

C value);<br />

For <strong>the</strong> explicit functions, memory is affected accord<strong>in</strong>g to parameters<br />

success and failure, depend<strong>in</strong>g on <strong>the</strong> result of <strong>the</strong> comparison.<br />

Jonas Skeppstedt (js@cs.lth.se) Lecture 6 2013 14 / 70

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!