ck_sequence: Add CK_SEQUENCE_READ operation.

ck_pring
Samy Al Bahra 11 years ago
parent 14b7e9e875
commit 3e5dcfe6fd

@ -85,6 +85,11 @@ ck_sequence_read_retry(struct ck_sequence *sq, unsigned int version)
return ck_pr_load_uint(&sq->sequence) != version;
}
#define CK_SEQUENCE_READ(seqlock, version) \
for (*(version) = 1; \
(*(version) != 0) && (*(version) = ck_sequence_read_begin(seqlock), 1); \
*(version) = ck_sequence_read_retry(seqlock, *(version)))
/*
* This must be called after a successful mutex acquisition.
*/

Loading…
Cancel
Save