diff options
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_cond.c | 8 | ||||
-rw-r--r-- | lib/libthr/thread/thr_create.c | 9 | ||||
-rw-r--r-- | lib/libthr/thread/thr_mutex.c | 8 | ||||
-rw-r--r-- | lib/libthr/thread/thr_private.h | 3 |
4 files changed, 9 insertions, 19 deletions
diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c index dedd3c2..b2cbb83 100644 --- a/lib/libthr/thread/thr_cond.c +++ b/lib/libthr/thread/thr_cond.c @@ -439,11 +439,11 @@ cond_queue_enq(pthread_cond_t cond, pthread_t pthread) name = pthread->name ? pthread->name : "unknown"; if ((pthread->flags & PTHREAD_FLAGS_IN_CONDQ) != 0) - _thread_printf(2, "Thread (%s:%u) already on condq\n", - pthread->name, pthread->uniqueid); + _thread_printf(2, "Thread (%s:%ld) already on condq\n", + pthread->name, pthread->thr_id); if ((pthread->flags & PTHREAD_FLAGS_IN_MUTEXQ) != 0) - _thread_printf(2, "Thread (%s:%u) already on mutexq\n", - pthread->name, pthread->uniqueid); + _thread_printf(2, "Thread (%s:%ld) already on mutexq\n", + pthread->name, pthread->thr_id); PTHREAD_ASSERT_NOT_IN_SYNCQ(pthread); /* diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 8eff861..a6193327 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -43,11 +43,8 @@ #include "thr_private.h" #include "libc_private.h" -static u_int64_t next_uniqueid = 1; - #define OFF(f) offsetof(struct pthread, f) int _thread_next_offset = OFF(tle.tqe_next); -int _thread_uniqueid_offset = OFF(uniqueid); int _thread_name_offset = OFF(name); int _thread_ctx_offset = OFF(ctx); #undef OFF @@ -137,12 +134,6 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, } new_thread->active_priority = new_thread->base_priority; - /* - * Initialise the unique id which GDB uses to - * track threads. - */ - new_thread->uniqueid = next_uniqueid++; - THREAD_LIST_LOCK; /* Add the thread to the linked list of all threads: */ diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 46a0625..ca16cb6 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -799,11 +799,11 @@ mutex_queue_enq(pthread_mutex_t mutex, pthread_t pthread) name = pthread->name ? pthread->name : "unknown"; if ((pthread->flags & PTHREAD_FLAGS_IN_CONDQ) != 0) - _thread_printf(2, "Thread (%s:%u) already on condq\n", - pthread->name, pthread->uniqueid); + _thread_printf(2, "Thread (%s:%ld) already on condq\n", + pthread->name, pthread->thr_id); if ((pthread->flags & PTHREAD_FLAGS_IN_MUTEXQ) != 0) - _thread_printf(2, "Thread (%s:%u) already on mutexq\n", - pthread->name, pthread->uniqueid); + _thread_printf(2, "Thread (%s:%ld) already on mutexq\n", + pthread->name, pthread->thr_id); PTHREAD_ASSERT_NOT_IN_SYNCQ(pthread); /* * For the common case of all threads having equal priority, diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index 4e78de2..e6ba4aa 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -478,8 +478,7 @@ struct pthread { #define PTHREAD_MAGIC ((u_int32_t) 0xd09ba115) u_int32_t magic; char *name; - u_int64_t uniqueid; /* for gdb */ - thr_id_t thr_id; + long thr_id; sigset_t savedsig; int signest; /* blocked signal netsting level */ int ptdflags; /* used by other other threads |