fixup more id vs. thread_id_t
[c11tester.git] / threads.cc
index a9395926816f38bc4872019a3047357574c1e2b9..ca4b28b1bc850c9ea5bcab709e2d27a9e74e2581 100644 (file)
 /** 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,10 +119,13 @@ 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),
        state(THREAD_CREATED),
+       wait_list(),
        last_action_val(VALUE_NONE)
 {
        int ret;