]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 4 Jan 2003 09:45:01 +0000 (09:45 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 4 Jan 2003 09:45:01 +0000 (09:45 +0000)
* old_pthread_cond_broadcast.c: Optimize initialization a bit to work
around gcc defficiencies.
* old_pthread_cond_signal.c: Likewise.
* old_pthread_cond_timedwait.c: Likewise.
* old_pthread_cond_wait.c: Likewise.

nptl/ChangeLog
nptl/old_pthread_cond_broadcast.c
nptl/old_pthread_cond_signal.c
nptl/old_pthread_cond_timedwait.c
nptl/old_pthread_cond_wait.c

index d8a27c8107bd0f19fd117ca4643cebda658f32e7..2025464bfbcaea5a20268e9b9781e2a2fa0a1088 100644 (file)
@@ -1,5 +1,11 @@
 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
 
+       * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
+       around gcc defficiencies.
+       * old_pthread_cond_signal.c: Likewise.
+       * old_pthread_cond_timedwait.c: Likewise.
+       * old_pthread_cond_wait.c: Likewise.
+
        * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
 
 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
index 19918b072fdfb08c25ed404c38d160c0b659dcf6..0db0aeab960b1f6ce25fecc4552f68797fda72c8 100644 (file)
@@ -33,13 +33,18 @@ __pthread_cond_broadcast_2_0 (cond)
     {
       pthread_cond_t *newcond;
 
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+       return ENOMEM;
+#else
       newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
       if (newcond == NULL)
        return ENOMEM;
 
-      *newcond = (pthread_cond_t) PTHREAD_COND_INITIALIZER;
-
-      atomic_write_barrier ();
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
 
       if (atomic_compare_and_exchange_acq (&cond->cond, newcond, NULL) != 0)
        /* Somebody else just initialized the condvar.  */
index c646b4dd402bf69edbfe914c99c86f6c19a5f120..ae54209e4a7513b3401acf12ab22c3f82bafec1a 100644 (file)
@@ -33,13 +33,18 @@ __pthread_cond_signal_2_0 (cond)
     {
       pthread_cond_t *newcond;
 
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+       return ENOMEM;
+#else
       newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
       if (newcond == NULL)
        return ENOMEM;
 
-      *newcond = (pthread_cond_t) PTHREAD_COND_INITIALIZER;
-
-      atomic_write_barrier ();
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
 
       if (atomic_compare_and_exchange_acq (&cond->cond, newcond, NULL) != 0)
        /* Somebody else just initialized the condvar.  */
index ef8047e1b8958119a9da4ff8864c7363cdfe4d16..b30e182b40fc18da4d2b17391ecfca1213fc348c 100644 (file)
@@ -35,13 +35,18 @@ __pthread_cond_timedwait_2_0 (cond, mutex, abstime)
     {
       pthread_cond_t *newcond;
 
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+       return ENOMEM;
+#else
       newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
       if (newcond == NULL)
        return ENOMEM;
 
-      *newcond = (pthread_cond_t) PTHREAD_COND_INITIALIZER;
-
-      atomic_write_barrier ();
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
 
       if (atomic_compare_and_exchange_acq (&cond->cond, newcond, NULL) != 0)
        /* Somebody else just initialized the condvar.  */
index 3b54faca69c0434d021dc83a6731c503d4fdb064..50505a265e0ce38607a98fa0a124714b62b30c9f 100644 (file)
@@ -34,13 +34,18 @@ __pthread_cond_wait_2_0 (cond, mutex)
     {
       pthread_cond_t *newcond;
 
+#if LLL_MUTEX_LOCK_INITIALIZER == 0
+      newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
+      if (newcond == NULL)
+       return ENOMEM;
+#else
       newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
       if (newcond == NULL)
        return ENOMEM;
 
-      *newcond = (pthread_cond_t) PTHREAD_COND_INITIALIZER;
-
-      atomic_write_barrier ();
+      /* Initialize the condvar.  */
+      (void) pthread_cond_init (newcond, NULL);
+#endif
 
       if (atomic_compare_and_exchange_acq (&cond->cond, newcond, NULL) != 0)
        /* Somebody else just initialized the condvar.  */