From 36860e64dbe0a6d294ec3b1430e7926ea0ed2fd5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 3 Nov 2006 18:55:00 +0000 Subject: remove duplicated/unused ASSERT code --- libpthread/linuxthreads.old/debug.h | 16 ---------------- libpthread/linuxthreads.old/internals.h | 11 ----------- libpthread/linuxthreads.old/manager.c | 3 --- libpthread/linuxthreads.old/queue.h | 1 - libpthread/linuxthreads.old/spinlock.c | 2 -- 5 files changed, 33 deletions(-) diff --git a/libpthread/linuxthreads.old/debug.h b/libpthread/linuxthreads.old/debug.h index a2ac5113a..94b7c084b 100644 --- a/libpthread/linuxthreads.old/debug.h +++ b/libpthread/linuxthreads.old/debug.h @@ -29,9 +29,6 @@ # define DEBUG_PT #endif -/* include asserts for now */ -#define DO_ASSERT - /* define the PDEBUG macro here */ #undef PDEBUG #ifdef DEBUG_PT @@ -40,17 +37,4 @@ # define PDEBUG(fmt, args...) /* debug switched off */ #endif -/* nothing; placeholder to disable a PDEBUG message but don't delete it */ -#undef PDEBUGG -#define PDEBUGG(fmt, args...) - -/* Define ASSERT to stop/warn. Should be void in production code */ -#undef ASSERT -#ifdef DO_ASSERT -# define ASSERT(x) if (!(x)) fprintf(stderr, "pt: assertion failed in %s:%i.\n",\ - __FILE__, __LINE__) -#else -# define ASSERT(x) -#endif - #endif /* _PT_DEBUG_H */ diff --git a/libpthread/linuxthreads.old/internals.h b/libpthread/linuxthreads.old/internals.h index 17b724e64..f1d5db16b 100644 --- a/libpthread/linuxthreads.old/internals.h +++ b/libpthread/linuxthreads.old/internals.h @@ -445,17 +445,6 @@ static inline pthread_descr thread_self (void) extern int __libc_multiple_threads attribute_hidden; extern int __librt_multiple_threads; -/* Debugging */ - -#ifdef DEBUG -#include -#define ASSERT assert -#define MSG __pthread_message -#else -#define ASSERT(x) -#define MSG(msg,arg...) -#endif - /* Internal global functions */ void __pthread_destroy_specifics(void); diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c index e57080d17..dbbee3f6f 100644 --- a/libpthread/linuxthreads.old/manager.c +++ b/libpthread/linuxthreads.old/manager.c @@ -148,7 +148,6 @@ int attribute_noreturn __pthread_manager(void *arg) /* Synchronize debugging of the thread manager */ n = TEMP_FAILURE_RETRY(__libc_read(reqfd, (char *)&request, sizeof(request))); - ASSERT(n == sizeof(request) && request.req_kind == REQ_DEBUG); #ifndef USE_SELECT ufd.fd = reqfd; ufd.events = POLLIN; @@ -187,7 +186,6 @@ int attribute_noreturn __pthread_manager(void *arg) PDEBUG("before __libc_read\n"); n = __libc_read(reqfd, (char *)&request, sizeof(request)); PDEBUG("after __libc_read, n=%d\n", n); - ASSERT(n == sizeof(request)); switch(request.req_kind) { case REQ_CREATE: PDEBUG("got REQ_CREATE\n"); @@ -698,7 +696,6 @@ static void pthread_free(pthread_descr th) pthread_readlock_info *iter, *next; char *h_bottom_save; - ASSERT(th->p_exited); /* Make the handle invalid */ handle = thread_handle(th->p_tid); __pthread_lock(&handle->h_lock, NULL); diff --git a/libpthread/linuxthreads.old/queue.h b/libpthread/linuxthreads.old/queue.h index 28bd75531..c7f8471b9 100644 --- a/libpthread/linuxthreads.old/queue.h +++ b/libpthread/linuxthreads.old/queue.h @@ -21,7 +21,6 @@ static inline void enqueue(pthread_descr * q, pthread_descr th) { int prio = th->p_priority; - ASSERT(th->p_nextwaiting == NULL); for (; *q != NULL; q = &((*q)->p_nextwaiting)) { if (prio > (*q)->p_priority) { th->p_nextwaiting = *q; diff --git a/libpthread/linuxthreads.old/spinlock.c b/libpthread/linuxthreads.old/spinlock.c index e00bc3156..f5999e4d2 100644 --- a/libpthread/linuxthreads.old/spinlock.c +++ b/libpthread/linuxthreads.old/spinlock.c @@ -620,8 +620,6 @@ void __pthread_alt_unlock(struct _pthread_fastlock *lock) if (maxprio == INT_MIN) continue; - ASSERT (p_max_prio != (struct wait_node *) 1); - /* Now we want to to remove the max priority thread's wait node from the list. Before we can do this, we must atomically try to change the node's abandon state from zero to nonzero. If we succeed, that means we -- cgit v1.2.3