Patchwork Go patch committed: Remove temporary function

login
register
mail settings
Submitter Ian Taylor
Date Dec. 1, 2011, 11:50 p.m.
Message ID <mcrborrluli.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/128780/
State New
Headers show

Comments

Ian Taylor - Dec. 1, 2011, 11:50 p.m.
I added the function runtime_cond_wait to libgo temporarily during the
conversion to multiplexing goroutines.  It is no longer needed and this
patch removes it.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Patch

diff -r 2ce500c576dc libgo/runtime/runtime.h
--- a/libgo/runtime/runtime.h	Thu Dec 01 10:55:24 2011 -0800
+++ b/libgo/runtime/runtime.h	Thu Dec 01 15:41:16 2011 -0800
@@ -337,6 +337,3 @@ 
 #ifdef __rtems__
 void __wrap_rtems_task_variable_add(void **);
 #endif
-
-/* Temporary.  */
-void	runtime_cond_wait(pthread_cond_t*, pthread_mutex_t*);
diff -r 2ce500c576dc libgo/runtime/thread.c
--- a/libgo/runtime/thread.c	Thu Dec 01 10:55:24 2011 -0800
+++ b/libgo/runtime/thread.c	Thu Dec 01 15:41:16 2011 -0800
@@ -90,27 +90,3 @@ 
 	if(sigaltstack(&ss, nil) < 0)
 		*(int *)0xf1 = 0xf1;
 }
-
-// Temporary functions, which will be removed when we stop using
-// condition variables.
-
-void
-runtime_cond_wait(pthread_cond_t* cond, pthread_mutex_t* mutex)
-{
-	int i;
-
-	runtime_entersyscall();
-
-	i = pthread_cond_wait(cond, mutex);
-	if(i != 0)
-		runtime_throw("pthread_cond_wait");
-	i = pthread_mutex_unlock(mutex);
-	if(i != 0)
-		runtime_throw("pthread_mutex_unlock");
-
-	runtime_exitsyscall();
-
-	i = pthread_mutex_lock(mutex);
-	if(i != 0)
-		runtime_throw("pthread_mutex_lock");
-}