about summary refs log tree commit diff
path: root/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-15 19:02:47 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-15 19:02:47 +0000
commit9aae19cd9aaf10e7d99c56f9d7d820c5b792faeb (patch)
tree16ffc7a009065b483f7a65230de3e01b6d111894 /linuxthreads/pthread.c
parent101c92fc39425a6e9010c769e3ae6c42c95fe7a8 (diff)
downloadglibc-9aae19cd9aaf10e7d99c56f9d7d820c5b792faeb.tar.gz
glibc-9aae19cd9aaf10e7d99c56f9d7d820c5b792faeb.tar.xz
glibc-9aae19cd9aaf10e7d99c56f9d7d820c5b792faeb.zip
Update.
2000-05-05  H.J. Lu  <hjl@gnu.org>

	* sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to
	have acquire semantics.
	(__compare_and_swap_with_release_semantics): New inline
	function.
	(HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro.

2000-01-28  Hans Boehm  <hboehm@exch.hpl.hp.com>

	* manager.c: Fix the problem with signals at startup.
	Change the way that thread stacks are allocated on IA64.
	Clean up some of the guard page allocation stuff.

1999-12-19  H.J. Lu  <hjl@gnu.org>

	* internals.h (page_roundup): New.
	* attr.c (__pthread_attr_setguardsize); Use page_roundup
	instead of roundup.
	* manager.c (pthread_allocate_stack): Make sure guardaddr is
	page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK
	is define.

1999-12-17  Hans Boehm  <hboehm@exch.hpl.hp.com>

	* manager.c (pthread_allocate_stack): Unmap the stack top
	if failed to map the stack bottom.
	Fix the guard page.
	(pthread_free): Fix the guard page.

	* pthread.c (pthread_initialize): Set rlimit correctly for
	NEED_SEPARATE_REGISTER_STACK.

1999-12-16  H.J. Lu  <hjl@gnu.org>

	* pthread.c (__pthread_initialize_manager): Pass
	__pthread_manager_thread_bos instead of
	__pthread_manager_thread_tos to __clone2.

1999-12-16  H.J. Lu  <hjl@gnu.org>

	* manager.c (pthread_allocate_stack): Correct the calculation
	of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for
	stack bottom.

1999-12-13  H.J. Lu  <hjl@gnu.org>

	* sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop
	bit after setting ar.ccv.

1999-12-12  H.J. Lu  <hjl@gnu.org>

	* manager.c (pthread_allocate_stack): Make the starting
	address of the stack bottom page aligned. FIXME: it may
	need changes in other places.
	(pthread_handle_create): Likewise.

1999-12-11  Hans Boehm  <hboehm@exch.hpl.hp.com>

	* manager.c (pthread_allocate_stack): Handle
	NEED_SEPARATE_REGISTER_STACK.
	(pthread_handle_create): Likewise.
	* pthread.c (__pthread_initialize_manager): Likewise.

	* sysdeps/ia64/pt-machine.h: Use r13 for thread pointer.

1999-12-02  H.J. Lu  <hjl@gnu.org>

	* sysdeps/ia64/pt-machine.h: New.
Diffstat (limited to 'linuxthreads/pthread.c')
-rw-r--r--linuxthreads/pthread.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 2700a29fb1..d70e3f4b1f 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -362,7 +362,13 @@ static void pthread_initialize(void)
   /* Play with the stack size limit to make sure that no stack ever grows
      beyond STACK_SIZE minus one page (to act as a guard page). */
   getrlimit(RLIMIT_STACK, &limit);
+#ifdef NEED_SEPARATE_REGISTER_STACK
+  /* STACK_SIZE bytes hold both the main stack and register backing
+     store. The rlimit value applies to each individually.  */
+  max_stack = STACK_SIZE/2 - __getpagesize();
+#else
   max_stack = STACK_SIZE - __getpagesize();
+#endif
   if (limit.rlim_cur > max_stack) {
     limit.rlim_cur = max_stack;
     setrlimit(RLIMIT_STACK, &limit);
@@ -444,10 +450,18 @@ int __pthread_initialize_manager(void)
 		   | __pthread_initial_thread.p_eventbuf.eventmask.event_bits[idx]))
 	  != 0)
 	{
+#ifdef NEED_SEPARATE_REGISTER_STACK
+	  pid = __clone2(__pthread_manager_event,
+			 (void **) __pthread_manager_thread_bos,
+			 THREAD_MANAGER_STACK_SIZE,
+			 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+			 (void *)(long)manager_pipe[0]);
+#else
 	  pid = __clone(__pthread_manager_event,
 			(void **) __pthread_manager_thread_tos,
 			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
 			(void *)(long)manager_pipe[0]);
+#endif
 
 	  if (pid != -1)
 	    {
@@ -472,9 +486,18 @@ int __pthread_initialize_manager(void)
     }
 
   if (pid == 0)
-    pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos,
-		  CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
-		  (void *)(long)manager_pipe[0]);
+    {
+#ifdef NEED_SEPARATE_REGISTER_STACK
+      pid = __clone2(__pthread_manager, (void **) __pthread_manager_thread_bos,
+		     THREAD_MANAGER_STACK_SIZE,
+		     CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+		     (void *)(long)manager_pipe[0]);
+#else
+      pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos,
+		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+		    (void *)(long)manager_pipe[0]);
+#endif
+    }
   if (pid == -1) {
     free(__pthread_manager_thread_bos);
     __libc_close(manager_pipe[0]);