#include "action.h"
#include "threads-model.h"
#include "clockvector.h"
+#include "execution.h"
-SCAnalysis::SCAnalysis() {
+SCAnalysis::SCAnalysis(const ModelExecution *execution) :
+ execution(execution)
+{
cvmap=new HashTable<const ModelAction *, ClockVector *, uintptr_t, 4>();
cycleset=new HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4>();
threadlists=new SnapVector<action_list_t>(1);
/* Merge in the clock vector from the write */
const ModelAction *write=read->get_reads_from();
ClockVector *writecv=cvmap->get(write);
- changed|= ( writecv == NULL || merge(cv, read, writecv) && (*read < *write));
+ changed |= writecv == NULL || (merge(cv, read, writecv) && (*read < *write));
for(int i=0;i<=maxthreads;i++) {
thread_id_t tid=int_to_id(i);
ClockVector *finishcv = cvmap->get(finish);
changed |= (finishcv == NULL) || merge(cv, act, finishcv);
}
- if (act->is_thread_join()) {
- Thread *joinedthr = act->get_thread_operand();
- ModelAction *finish = model->get_last_action(joinedthr->get_id());
- ClockVector *finishcv = cvmap->get(finish);
- changed |= (finishcv == NULL) || cv->merge(finishcv);
- }
if (act->is_read()) {
changed|=processRead(act, cv);
}