1
0
mirror of https://github.com/golang/go synced 2024-11-23 22:50:05 -07:00

runtime: fix build after CL 9164 on Linux

There is an assumption that the function executed in child thread
created by runtime.close should not return. And different systems
enforce that differently: some exit that thread, some exit the
whole process.

The test TestNewOSProc0 introduced in CL 9161 breaks that assumption,
so we need to adjust the code to only exit the thread should the
called function return.

Change-Id: Id631cb2f02ec6fbd765508377a79f3f96c6a2ed6
Reviewed-on: https://go-review.googlesource.com/9246
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Shenghou Ma 2015-04-22 18:03:18 -04:00 committed by Minux Ma
parent 43618e62ca
commit edc53e1f14
4 changed files with 6 additions and 6 deletions

View File

@ -350,7 +350,7 @@ nog:
// Call fn
CALL R12
// It shouldn't return. If it does, exit
// It shouldn't return. If it does, exit that thread.
MOVL $111, DI
MOVL $60, AX
SYSCALL

View File

@ -307,7 +307,7 @@ nog:
MOVW $16(R13), R13
BL (R0)
// It shouldn't return
// It shouldn't return. If it does, exit that thread.
MOVW $0, R0
MOVW R0, 4(R13)
BL runtime·exit1(SB)

View File

@ -361,10 +361,10 @@ nog:
MOVD R12, R0
BL (R0)
// It shouldn't return. If it does, exit
// It shouldn't return. If it does, exit that thread.
MOVW $111, R0
again:
MOVD $SYS_exit_group, R8
MOVD $SYS_exit, R8
SVC
B again // keep exiting

View File

@ -346,9 +346,9 @@ nog:
MOVD R12, CTR
BL (CTR)
// It shouldn't return. If it does, exit
// It shouldn't return. If it does, exit that thread.
MOVW $111, R3
SYSCALL $SYS_exit_group
SYSCALL $SYS_exit
BR -2(PC) // keep exiting
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8