From 334dbf9134ad466daad8c1a02b9c33373e3d3619 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 12 Mar 2012 23:08:12 -0700 Subject: [PATCH] libthreads: use model-checker's thread ID assignment --- libthreads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libthreads.c b/libthreads.c index 6a549d4..ff51b6a 100644 --- a/libthreads.c +++ b/libthreads.c @@ -47,6 +47,7 @@ static int create_context(struct thread *t) static int create_initial_thread(struct thread *t) { memset(t, 0, sizeof(*t)); + model_checker_assign_id(t); return create_context(t); } @@ -101,13 +102,12 @@ static void thread_wait_finish(void) */ int thread_create(struct thread *t, void (*start_routine), void *arg) { - static int created = 1; int ret = 0; DBG(); memset(t, 0, sizeof(*t)); - t->index = created++; + model_checker_assign_id(t); DEBUG("create thread %d\n", t->index); t->start_routine = start_routine; -- 2.34.1