summaryrefslogtreecommitdiffstats
path: root/libgo/runtime/go-recover.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-28 05:45:49 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-28 05:45:49 +0000
commit6e7609c89e6a81303eaf119a7c3bfca6dd4098ac (patch)
treeaf256a0152425084325ad100d75615322c726b8a /libgo/runtime/go-recover.c
parentbda4944f9fd4e25eef1c093ff7ba7f7aaa709539 (diff)
downloadppe42-gcc-6e7609c89e6a81303eaf119a7c3bfca6dd4098ac.tar.gz
ppe42-gcc-6e7609c89e6a81303eaf119a7c3bfca6dd4098ac.zip
runtime: Multiplex goroutines onto OS threads.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181772 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime/go-recover.c')
-rw-r--r--libgo/runtime/go-recover.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/runtime/go-recover.c b/libgo/runtime/go-recover.c
index fe6031c100f..7101d518ade 100644
--- a/libgo/runtime/go-recover.c
+++ b/libgo/runtime/go-recover.c
@@ -18,10 +18,13 @@
_Bool
__go_can_recover (const void* retaddr)
{
+ G *g;
struct __go_defer_stack *d;
const char* ret;
const char* dret;
+ g = runtime_g ();
+
d = g->defer;
if (d == NULL)
return 0;
@@ -50,8 +53,11 @@ __go_can_recover (const void* retaddr)
struct __go_empty_interface
__go_recover ()
{
+ G *g;
struct __go_panic_stack *p;
+ g = runtime_g ();
+
if (g->panic == NULL || g->panic->__was_recovered)
{
struct __go_empty_interface ret;
OpenPOWER on IntegriCloud