From: Brian Norris Date: Tue, 13 Mar 2012 06:08:12 +0000 (-0700) Subject: libthreads: use model-checker's thread ID assignment X-Git-Tag: pldi2013~587 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=334dbf9134ad466daad8c1a02b9c33373e3d3619;p=model-checker.git libthreads: use model-checker's thread ID assignment --- 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;