nodestack.o clockvector.o main.o snapshot-interface.o cyclegraph.o \
datarace.o impatomic.o cmodelint.o \
snapshot.o malloc.o mymemory.o common.o mutex.o conditionvariable.o \
- context.o execution.o libannotate.o plugins.o pthread.o futex.o fuzzer.o
+ context.o execution.o libannotate.o plugins.o pthread.o futex.o fuzzer.o \
+ sleeps.o
CPPFLAGS += -Iinclude -I.
LDFLAGS := -ldl -lrt -rdynamic
seq_number(ACTION_INITIAL_CLOCK)
{
/* References to NULL atomic variables can end up here */
- ASSERT(loc || type == ATOMIC_FENCE);
+ ASSERT(loc || type == ATOMIC_FENCE || type == NOOP);
Thread *t = thread ? thread : thread_current();
this->tid = t->get_id();
Thread *t = thread ? thread : thread_current();
this->tid = t->get_id();
- model_print("position: %s\n", position);
+ // model_print("position: %s\n", position);
}
ATOMIC_NOTIFY_ALL, // < A notify all action
ATOMIC_WAIT, // < A wait action
ATOMIC_ANNOTATION, // < An annotation action to pass information to a trace analysis
- NOOP
+ NOOP // no operation, which returns control to scheduler
} action_type_t;
wake_up_sleeping_actions(curr);
/* Add the action to lists before any other model-checking tasks */
- if (!second_part_of_rmw)
+ if (!second_part_of_rmw && curr->get_type() != NOOP)
add_action_to_lists(curr);
SnapVector<ModelAction *> * rf_set = NULL;
* @see ModelExecution::release_seq_heads
*/
void ModelExecution::get_release_seq_heads(ModelAction *acquire,
- ModelAction *read, rel_heads_list_t *release_heads)
+ ModelAction *read, rel_heads_list_t *release_heads)
{
const ModelAction *rf = read->get_reads_from();
--- /dev/null
+#include <time.h>
+#include <unistd.h>
+
+#include "action.h"
+#include "model.h"
+
+unsigned int __sleep (unsigned int seconds)
+{
+ model->switch_to_master(
+ new ModelAction(NOOP, std::memory_order_seq_cst, NULL)
+ );
+ return 0;
+}
+
+unsigned int sleep(unsigned int seconds)
+{
+ return __sleep(seconds);
+}
+
+int usleep (useconds_t useconds)
+{
+ model->switch_to_master(
+ new ModelAction(NOOP, std::memory_order_seq_cst, NULL)
+ );
+ return 0;
+}