forked from weaselab/conflict-set
+18
-1
@@ -19,7 +19,15 @@ limitations under the License.
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/** A data structure for optimistic concurrency control on ranges of
|
||||
* bitwise-lexicographically-ordered keys.
|
||||
*
|
||||
* Thread safety:
|
||||
* - It's safe to operate on two different ConflictSets in two different
|
||||
* threads concurrently
|
||||
* - It's safe to have multiple threads operating on the same ConflictSet
|
||||
* concurrently if and only if all threads only call `check`.
|
||||
*/
|
||||
struct __attribute__((__visibility__("default"))) ConflictSet {
|
||||
enum Result {
|
||||
/** The result of a check which does not intersect any conflicting writes */
|
||||
@@ -92,6 +100,15 @@ private:
|
||||
|
||||
#else
|
||||
|
||||
/** A data structure for optimistic concurrency control on ranges of
|
||||
* bitwise-lexicographically-ordered keys.
|
||||
*
|
||||
* Thread safety:
|
||||
* - It's safe to operate on two different ConflictSets in two different
|
||||
* threads concurrently
|
||||
* - It's safe to have multiple threads operating on the same ConflictSet
|
||||
* concurrently if and only if all threads only call `check`.
|
||||
*/
|
||||
typedef struct ConflictSet ConflictSet;
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user