aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-13 00:56:15 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-13 00:56:15 +0000
commit5d409851a35412607aeccef8426f402fbf27a102 (patch)
treea215d7204ea129f65f77405b3e9150c105c2a4e1 /linuxthreads/sysdeps
parent441e41325ef99b5b469ae1291c309769464c5de9 (diff)
downloadglibc-5d409851a35412607aeccef8426f402fbf27a102.tar
glibc-5d409851a35412607aeccef8426f402fbf27a102.tar.gz
glibc-5d409851a35412607aeccef8426f402fbf27a102.tar.bz2
glibc-5d409851a35412607aeccef8426f402fbf27a102.zip
Update.
1998-03-13 00:46 Ulrich Drepper <drepper@cygnus.com> * attr.c: Implement pthread_attr_[gs]etguardsize, pthread_attr_[gs]setstackaddr, pthread_attr_[gs]etstacksize. Change pthread_attr_init to have two interfaces. * internals.h (struct _pthread_descr_struct): Add new fields for above functions. * libpthread.map: Add names in GLIBC_2.1 section. * manager.c (pthread_handle_create): Implement guardsize and user stack. (pthread_free): Likewise. * pthread.c (pthread_create): Add new interface for changed pthread_attr_t. * sysdeps/pthread/pthread.h: Add prototypes for new functions. * sysdeps/unix/sysv/linux/bits/local_lim.h: Add definition of PTHREAD_STACK_MIN. * manager.c: Enable resetting of the thread scheduling policy to SCHED_OTHER when the parent thread has a different one.
Diffstat (limited to 'linuxthreads/sysdeps')
-rw-r--r--linuxthreads/sysdeps/pthread/pthread.h56
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h5
2 files changed, 60 insertions, 1 deletions
diff --git a/linuxthreads/sysdeps/pthread/pthread.h b/linuxthreads/sysdeps/pthread/pthread.h
index b62706a811..9f5e9deef2 100644
--- a/linuxthreads/sysdeps/pthread/pthread.h
+++ b/linuxthreads/sysdeps/pthread/pthread.h
@@ -119,6 +119,10 @@ typedef struct
struct sched_param schedparam;
int inheritsched;
int scope;
+ size_t guardsize;
+ int stackaddr_set;
+ void *stackaddr;
+ size_t stacksize;
} pthread_attr_t;
enum
@@ -272,6 +276,49 @@ extern int pthread_attr_setscope __P ((pthread_attr_t *__attr, int __scope));
extern int pthread_attr_getscope __P ((__const pthread_attr_t *__attr,
int *__scope));
+#ifdef __USE_UNIX98
+/* Set the size of the guard area at the bottom of the thread. */
+extern int __pthread_attr_setguardsize __P ((pthread_attr_t *__attr,
+ size_t __guardsize));
+extern int pthread_attr_setguardsize __P ((pthread_attr_t *__attr,
+ size_t __guardsize));
+
+/* Get the size of the guard area at the bottom of the thread. */
+extern int __pthread_attr_getguardsize __P ((__const pthread_attr_t *__attr,
+ size_t *__guardsize));
+extern int pthread_attr_getguardsize __P ((__const pthread_attr_t *__attr,
+ size_t *__guardsize));
+
+/* Set the starting address of the stack of the thread to be created.
+ Depending on whether the stack grows up or doen the value must either
+ be higher or lower than all the address in the memory block. The
+ minimal size of the block must be PTHREAD_STACK_SIZE. */
+extern int __pthread_attr_setstackaddr __P ((pthread_attr_t *__attr,
+ void *__stackaddr));
+extern int pthread_attr_setstackaddr __P ((pthread_attr_t *__attr,
+ void *__stackaddr));
+
+/* Return the previously set address for the stack. */
+extern int __pthread_attr_getstackaddr __P ((__const pthread_attr_t *__attr,
+ void **__stackaddr));
+extern int pthread_attr_getstackaddr __P ((__const pthread_attr_t *__attr,
+ void **__stackaddr));
+
+/* Add information about the minimum stack size needed for the thread
+ to be started. This size must never be less than PTHREAD_STACK_SIZE
+ and must also not exceed the system limits. */
+extern int __pthread_attr_setstacksize __P ((pthread_attr_t *__attr,
+ size_t __stacksize));
+extern int pthread_attr_setstacksize __P ((pthread_attr_t *__attr,
+ size_t __stacksize));
+
+/* Return the currently used minimal stack size. */
+extern int __pthread_attr_getstacksize __P ((__const pthread_attr_t *__attr,
+ size_t *__stacksize));
+extern int pthread_attr_getstacksize __P ((__const pthread_attr_t *__attr,
+ size_t *__stacksize));
+#endif
+
/* Functions for scheduling control. */
/* Set the scheduling parameters for TARGET_THREAD according to POLICY
@@ -284,6 +331,15 @@ extern int pthread_getschedparam __P ((pthread_t __target_thread,
int *__policy,
struct sched_param *__param));
+#ifdef __USE_UNIX98
+/* Determine level of concurrency. */
+extern int __pthread_getconcurrency __P ((void));
+extern int pthread_getconcurrency __P ((void));
+
+/* Set new concurrency level to LEVEL. */
+extern int __pthread_setconcurrency __P ((int __level));
+extern int pthread_setconcurrency __P ((int __level));
+#endif
/* Functions for mutex handling. */
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h b/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
index 68635ba36f..f884863ffa 100644
--- a/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
+++ b/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Linux version.
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,3 +38,6 @@
/* Maximum amount by which a process can descrease its asynchronous I/O
priority level. */
#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 16384