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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Specify<strong>in</strong>g Wait<strong>in</strong>g Time<br />

The struct xtime conta<strong>in</strong>s at least <strong>the</strong> follow<strong>in</strong>g members.<br />

time_t sec;<br />

long nsec;<br />

They may be declared <strong>in</strong> any order <strong>in</strong> <strong>the</strong> struct.<br />

This means that code which compares two char-po<strong>in</strong>ters (each<br />

po<strong>in</strong>t<strong>in</strong>g to one of <strong>the</strong>m) should not assume one is before <strong>the</strong> o<strong>the</strong>r.<br />

In struct { <strong>in</strong>t a, b; } c; <strong>in</strong>t* p = &c.a; <strong>in</strong>t* q = &c.b;<br />

we know that p < q, s<strong>in</strong>ce a is declared before b.<br />

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

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

Saved successfully!

Ooh no, something went wrong!