delete cv;
}
-bool ModelAction::is_read()
+bool ModelAction::is_read() const
{
return type == ATOMIC_READ;
}
-bool ModelAction::is_write()
+bool ModelAction::is_write() const
{
return type == ATOMIC_WRITE;
}
-bool ModelAction::is_rmw()
+bool ModelAction::is_rmw() const
{
return type == ATOMIC_RMW;
}
-bool ModelAction::is_acquire()
+bool ModelAction::is_acquire() const
{
switch (order) {
case memory_order_acquire:
}
}
-bool ModelAction::is_release()
+bool ModelAction::is_release() const
{
switch (order) {
case memory_order_release:
}
}
-bool ModelAction::is_seqcst()
+bool ModelAction::is_seqcst() const
{
return order==memory_order_seq_cst;
}
-bool ModelAction::same_var(ModelAction *act)
+bool ModelAction::same_var(const ModelAction *act) const
{
return location == act->location;
}
-bool ModelAction::same_thread(ModelAction *act)
+bool ModelAction::same_thread(const ModelAction *act) const
{
return tid == act->tid;
}
* @return tells whether we have to explore a reordering.
*/
-bool ModelAction::is_synchronizing(ModelAction *act)
+bool ModelAction::is_synchronizing(const ModelAction *act) const
{
//Same thread can't be reordered
if (same_thread(act))
~ModelAction();
void print(void);
- thread_id_t get_tid() { return tid; }
- action_type get_type() { return type; }
- memory_order get_mo() { return order; }
- void * get_location() { return location; }
+ thread_id_t get_tid() const { return tid; }
+ action_type get_type() const { return type; }
+ memory_order get_mo() const { return order; }
+ void * get_location() const { return location; }
int get_seq_number() const { return seq_number; }
- Node * get_node() { return node; }
+ Node * get_node() const { return node; }
void set_node(Node *n) { node = n; }
- bool is_read();
- bool is_write();
- bool is_rmw();
- bool is_acquire();
- bool is_release();
- bool is_seqcst();
- bool same_var(ModelAction *act);
- bool same_thread(ModelAction *act);
- bool is_synchronizing(ModelAction *act);
+ bool is_read() const;
+ bool is_write() const;
+ bool is_rmw() const;
+ bool is_acquire() const;
+ bool is_release() const;
+ bool is_seqcst() const;
+ bool same_var(const ModelAction *act) const;
+ bool same_thread(const ModelAction *act) const;
+ bool is_synchronizing(const ModelAction *act) const;
void create_cv(ModelAction *parent = NULL);
void read_from(ModelAction *act);