svn commit: trunk/uClibc/libpthread/linuxthreads.old

vapier at uclibc.org vapier at uclibc.org
Fri Nov 3 10:55:00 PST 2006


Author: vapier
Date: 2006-11-03 10:55:00 -0800 (Fri, 03 Nov 2006)
New Revision: 16493

Log:
remove duplicated/unused ASSERT code

Modified:
   trunk/uClibc/libpthread/linuxthreads.old/debug.h
   trunk/uClibc/libpthread/linuxthreads.old/internals.h
   trunk/uClibc/libpthread/linuxthreads.old/manager.c
   trunk/uClibc/libpthread/linuxthreads.old/queue.h
   trunk/uClibc/libpthread/linuxthreads.old/spinlock.c


Changeset:
Modified: trunk/uClibc/libpthread/linuxthreads.old/debug.h
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/debug.h	2006-11-03 18:52:35 UTC (rev 16492)
+++ trunk/uClibc/libpthread/linuxthreads.old/debug.h	2006-11-03 18:55:00 UTC (rev 16493)
@@ -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 */

Modified: trunk/uClibc/libpthread/linuxthreads.old/internals.h
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/internals.h	2006-11-03 18:52:35 UTC (rev 16492)
+++ trunk/uClibc/libpthread/linuxthreads.old/internals.h	2006-11-03 18:55:00 UTC (rev 16493)
@@ -445,17 +445,6 @@
 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);

Modified: trunk/uClibc/libpthread/linuxthreads.old/manager.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/manager.c	2006-11-03 18:52:35 UTC (rev 16492)
+++ trunk/uClibc/libpthread/linuxthreads.old/manager.c	2006-11-03 18:55:00 UTC (rev 16493)
@@ -148,7 +148,6 @@
   /* 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 @@
       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 @@
   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);

Modified: trunk/uClibc/libpthread/linuxthreads.old/queue.h
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/queue.h	2006-11-03 18:52:35 UTC (rev 16492)
+++ trunk/uClibc/libpthread/linuxthreads.old/queue.h	2006-11-03 18:55:00 UTC (rev 16493)
@@ -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;

Modified: trunk/uClibc/libpthread/linuxthreads.old/spinlock.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/spinlock.c	2006-11-03 18:52:35 UTC (rev 16492)
+++ trunk/uClibc/libpthread/linuxthreads.old/spinlock.c	2006-11-03 18:55:00 UTC (rev 16493)
@@ -620,8 +620,6 @@
     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



More information about the uClibc-cvs mailing list