Browse Source

remove duplicated/unused ASSERT code

Mike Frysinger 17 years ago
parent
commit
36860e64db

+ 0 - 16
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 */

+ 0 - 11
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 <assert.h>
-#define ASSERT assert
-#define MSG __pthread_message
-#else
-#define ASSERT(x)
-#define MSG(msg,arg...)
-#endif
-
 /* Internal global functions */
 
 void __pthread_destroy_specifics(void);

+ 0 - 3
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);

+ 0 - 1
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;

+ 0 - 2
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