OSSP CVS Repository

ossp - Check-in [424]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 424
Date: 2001-Mar-24 16:55:33 (local)
2001-Mar-24 15:55:33 (UTC)
User:rse
Branch:
Comment: *** empty log message ***
Tickets:
Inspections:
Files:
ossp-pkg/pth/ChangeLog      1.542 -> 1.543     5 inserted, 0 deleted
ossp-pkg/pth/pthread.c      1.55 -> 1.56     25 inserted, 0 deleted
ossp-pkg/pth/pthread.h.in      1.58 -> 1.59     4 inserted, 0 deleted

ossp-pkg/pth/ChangeLog 1.542 -> 1.543

--- ChangeLog    2001/03/24 15:46:32     1.542
+++ ChangeLog    2001/03/24 15:55:33     1.543
@@ -21,6 +21,11 @@
     
   Changes between 1.4a3 and 1.4a4 (29-Jul-2000 to 24-Mar-2001)
 
+   *) Implemented the pthread_{set,get}concurrency() API parts of
+      POSIX/SUSv2, although internally we are (allowed to be) free to not
+      do anything based on the requested level.
+      [Ralf S. Engelschall, Bill Apt <babt@us.ibm.com>]
+
    *) Adjusted all pthread_attr_getXXXX() functions to use a "const
       pthread_attr_t *" as the first argument instead of "pthread_attr_t
       *" to fully-conform to POSIX/SUSv2.


ossp-pkg/pth/pthread.c 1.55 -> 1.56

--- pthread.c    2001/03/24 15:46:32     1.55
+++ pthread.c    2001/03/24 15:55:33     1.56
@@ -384,6 +384,31 @@
 }
 
 /*
+**  CONCURRENCY ROUTINES
+**  
+**  We just have to provide the interface, because SUSv2 says:
+**  "The pthread_setconcurrency() function allows an application to
+**  inform the threads implementation of its desired concurrency
+**  level, new_level. The actual level of concurrency provided by the
+**  implementation as a result of this function call is unspecified."
+*/
+
+static int pthread_concurrency = 0;
+
+int pthread_getconcurrency(void)
+{
+    return pthread_concurrency;
+}
+
+int pthread_setconcurrency(int new_level)
+{
+    if (new_level < 0)
+        return_errno(EINVAL, EINVAL);
+    pthread_concurrency = new_level;
+    return OK;
+}
+
+/*
 **  CONTEXT ROUTINES
 */
 


ossp-pkg/pth/pthread.h.in 1.58 -> 1.59

--- pthread.h.in 2001/03/24 15:46:32     1.58
+++ pthread.h.in 2001/03/24 15:55:33     1.59
@@ -339,6 +339,10 @@
 extern int       pthread_sigmask(int, const sigset_t *, sigset_t *);
 extern int       pthread_kill(pthread_t, int);
 
+/* concurrency routines */
+extern int       pthread_getconcurrency(void);
+extern int       pthread_setconcurrency(int);
+
 /* context routines */
 extern int       pthread_key_create(pthread_key_t *, void (*)(void *));
 extern int       pthread_key_delete(pthread_key_t);

CVSTrac 2.0.1