X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=threads.cc;h=ca4b28b1bc850c9ea5bcab709e2d27a9e74e2581;hp=7fa4507ee94397e7e092730567901de94cf07a46;hb=2de6c82d6d7e6af2267636ec55f7e81d2a799a78;hpb=0accacf66b9f7bb4479205a0840f208dd8da6960 diff --git a/threads.cc b/threads.cc index 7fa4507..ca4b28b 100644 --- a/threads.cc +++ b/threads.cc @@ -12,13 +12,13 @@ /** Allocate a stack for a new thread. */ static void * stack_allocate(size_t size) { - return malloc(size); + return snapshot_malloc(size); } /** Free a stack for a terminated thread. */ static void stack_free(void *stack) { - free(stack); + snapshot_free(stack); } /** Return the currently executing thread. */ @@ -105,7 +105,7 @@ int Thread::swap(ucontext_t *ctxt, Thread *t) void Thread::complete() { if (!is_complete()) { - DEBUG("completed thread %d\n", get_id()); + DEBUG("completed thread %d\n", id_to_int(get_id())); state = THREAD_COMPLETED; if (stack) stack_free(stack); @@ -119,6 +119,8 @@ void Thread::complete() * @param a The parameter to pass to this function. */ Thread::Thread(thrd_t *t, void (*func)(void *), void *a) : + creation(NULL), + pending(NULL), start_routine(func), arg(a), user_thread(t),