From 9bbf98ac065e34fc1c35538328d02d51e74ccc0f Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 3 Dec 2012 16:43:19 -0800 Subject: [PATCH] action: record last fence release from the current thread --- action.cc | 1 + action.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/action.cc b/action.cc index 3d46bd9..5ecc1f0 100644 --- a/action.cc +++ b/action.cc @@ -31,6 +31,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, location(loc), value(value), reads_from(NULL), + last_fence_release(NULL), node(NULL), seq_number(ACTION_INITIAL_CLOCK), cv(NULL), diff --git a/action.h b/action.h index 66ba753..4c40bd9 100644 --- a/action.h +++ b/action.h @@ -85,6 +85,12 @@ public: Node * get_node() const { return node; } void set_node(Node *n) { node = n; } + /** Store the most recent fence-release from the same thread + * @param fence The fence-release that occured prior to this */ + void set_last_fence_release(const ModelAction *fence) { last_fence_release = fence; } + /** @return The most recent fence-release from the same thread */ + const ModelAction * get_last_fence_release() const { return last_fence_release; } + void copy_from_new(ModelAction *newaction); void set_seq_number(modelclock_t num); void set_try_lock(bool obtainedlock); @@ -158,6 +164,9 @@ private: /** The action that this action reads from. Only valid for reads */ const ModelAction *reads_from; + /** The last fence release from the same thread */ + const ModelAction *last_fence_release; + /** A back reference to a Node in NodeStack, if this ModelAction is * saved on the NodeStack. */ Node *node; -- 2.34.1