about summary refs log tree commit diff
path: root/linuxthreads/manager.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-13 05:57:21 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-13 05:57:21 +0000
commitd8d914df6806c6057b20c7311cad0bc2ac201c03 (patch)
tree6d2512373ef92b0abbebd4e0d0761cdd9715ea0b /linuxthreads/manager.c
parentb3ae0650bcff54f12d87f878000d4c488b365bf7 (diff)
downloadglibc-d8d914df6806c6057b20c7311cad0bc2ac201c03.tar.gz
glibc-d8d914df6806c6057b20c7311cad0bc2ac201c03.tar.xz
glibc-d8d914df6806c6057b20c7311cad0bc2ac201c03.zip
Update.
	* sysdeps/pthread/pthread.h: Add prototypes for pthread_spin_init,
	pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
	and pthread_spin_unlock.
	* sysdeps/pthread/bits/pthreadtypes.h: Change struct _pthread_fastlock
	into pthread_spinlock_t.  Change all uses.
	* spinlock.c: Implement pthread_spin_lock.
	Rename __pthread_unlock to __pthread_spin_unlock and define weak
	alias for real name.
	Define pthread_spin_trylock, pthread_spin_init, and
	pthread_spin_destroy.
	Change all uses of _pthread_fastlock to pthread_spinlock_t.
	* spinlock.h: Rename __pthread_unlock to __pthread_spin_unlock.
	Change all uses of _pthread_fastlock to pthread_spinlock_t.
	* Versions [libpthread] (GLIBC_2.2): Add pthread_spin_init,
	pthread_spin_destroy, pthread_spin_lock, pthread_spin_trylock,
	and pthread_spin_unlock.
	* cancel.c: Use __pthread_spin_unlock instead of __pthread_unlock.
	Change all uses of _pthread_fastlock to pthread_spinlock_t.
	* condvar.c: Likewise.
	* internals.h: Likewise.
	* join.c: Likewise.
	* manager.c: Likewise.
	* mutex.c: Likewise.
	* pthread.c: Likewise.
	* rwlock.c: Likewise.
	* semaphore.c: Likewise.
	* signals.c: Likewise.
Diffstat (limited to 'linuxthreads/manager.c')
-rw-r--r--linuxthreads/manager.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 6e585be79c..5d7014ab72 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -194,7 +194,7 @@ int __pthread_manager_event(void *arg)
   /* Get the lock the manager will free once all is correctly set up.  */
   __pthread_lock (THREAD_GETMEM((&__pthread_manager_thread), p_lock), NULL);
   /* Free it immediately.  */
-  __pthread_unlock (THREAD_GETMEM((&__pthread_manager_thread), p_lock));
+  __pthread_spin_unlock (THREAD_GETMEM((&__pthread_manager_thread), p_lock));
 
   return __pthread_manager(arg);
 }
@@ -260,7 +260,7 @@ static int pthread_start_thread_event(void *arg)
   /* Get the lock the manager will free once all is correctly set up.  */
   __pthread_lock (THREAD_GETMEM(self, p_lock), NULL);
   /* Free it immediately.  */
-  __pthread_unlock (THREAD_GETMEM(self, p_lock));
+  __pthread_spin_unlock (THREAD_GETMEM(self, p_lock));
 
   /* Continue with the real function.  */
   return pthread_start_thread (arg);
@@ -460,7 +460,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
 	      __linuxthreads_create_event ();
 
 	      /* Now restart the thread.  */
-	      __pthread_unlock(new_thread->p_lock);
+	      __pthread_spin_unlock(new_thread->p_lock);
 	    }
 	}
     }
@@ -509,7 +509,7 @@ static void pthread_free(pthread_descr th)
   __pthread_lock(&handle->h_lock, NULL);
   handle->h_descr = NULL;
   handle->h_bottom = (char *)(-1L);
-  __pthread_unlock(&handle->h_lock);
+  __pthread_spin_unlock(&handle->h_lock);
 #ifdef FREE_THREAD_SELF
   FREE_THREAD_SELF(th, th->p_nr);
 #endif
@@ -580,7 +580,7 @@ static void pthread_exited(pid_t pid)
 	    }
 	}
       detached = th->p_detached;
-      __pthread_unlock(th->p_lock);
+      __pthread_spin_unlock(th->p_lock);
       if (detached)
 	pthread_free(th);
       break;
@@ -623,19 +623,19 @@ static void pthread_handle_free(pthread_t th_id)
   if (invalid_handle(handle, th_id)) {
     /* pthread_reap_children has deallocated the thread already,
        nothing needs to be done */
-    __pthread_unlock(&handle->h_lock);
+    __pthread_spin_unlock(&handle->h_lock);
     return;
   }
   th = handle->h_descr;
   if (th->p_exited) {
-    __pthread_unlock(&handle->h_lock);
+    __pthread_spin_unlock(&handle->h_lock);
     pthread_free(th);
   } else {
     /* The Unix process of the thread is still running.
        Mark the thread as detached so that the thread manager will
        deallocate its resources when the Unix process exits. */
     th->p_detached = 1;
-    __pthread_unlock(&handle->h_lock);
+    __pthread_spin_unlock(&handle->h_lock);
   }
 }