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

vapier at uclibc.org vapier at uclibc.org
Thu Dec 22 01:46:10 UTC 2005


Author: vapier
Date: 2005-12-21 17:46:09 -0800 (Wed, 21 Dec 2005)
New Revision: 12973

Log:
Jie Zhang writes:
I think the loop was written for MMU case. When there is MMU, mmap ()
is used to allocate the stack. If one segment is already mapped, we
should continue to see if we can use the next one. However, for NOMMU,
malloc () is used. It's waste of CPU cycles to continue to try if it
fails. Here is a new patch, which makes this change only for NOMMU.


Modified:
   trunk/uClibc/libpthread/linuxthreads.old/manager.c


Changeset:
Modified: trunk/uClibc/libpthread/linuxthreads.old/manager.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/manager.c	2005-12-22 00:34:02 UTC (rev 12972)
+++ trunk/uClibc/libpthread/linuxthreads.old/manager.c	2005-12-22 01:46:09 UTC (rev 12973)
@@ -498,6 +498,14 @@
                                  &new_thread, &new_thread_bottom,
                                  &guardaddr, &guardsize) == 0)
         break;
+#ifndef __ARCH_HAS_MMU__
+      else
+        /* When there is MMU, mmap () is used to allocate the stack. If one
+         * segment is already mapped, we should continue to see if we can
+         * use the next one. However, when there is no MMU, malloc () is used.
+         * It's waste of CPU cycles to continue to try if it fails.  */
+        return EAGAIN;
+#endif
     }
   __pthread_handles_num++;
   /* Allocate new thread identifier */




More information about the uClibc-cvs mailing list