doc: Add CK_SEQUENCE_READ documentation.

ck_pring
Samy Al Bahra 12 years ago
parent 7d1c1d49e6
commit 14b7e9e875

@ -99,15 +99,21 @@ reader(void)
* ck_sequence_read_retry then attempt another read since * ck_sequence_read_retry then attempt another read since
* the data may be in an inconsistent state. * the data may be in an inconsistent state.
*/ */
CK_SEQUENCE_READ(&seqlock, &version) {
copy = global;
}
do { do {
version = ck_sequence_read_begin(&seqlock); version = ck_sequence_read_begin(&seqlock);
copy = global; copy = global;
} while (ck_sequence_read_retry(&seqlock, version)); } while (ck_sequence_read_retry(&seqlock, version));
/*
* The previous may also be expressed using CK_SEQUENCE_READ.
* Generally recommend to only use ck_sequence_read_retry
* if you would like to detect a conflicting write at some
* higher granularity.
*/
CK_SEQUENCE_READ(&seqlock, version) {
copy = global;
}
return; return;
} }

Loading…
Cancel
Save