2014-08-24 11:50:37 +04:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
// This file implements runtime support for signal handling.
|
|
|
|
|
|
|
|
|
|
package runtime
|
|
|
|
|
|
|
|
|
|
func signal_recv() (m uint32) {
|
|
|
|
|
for {
|
|
|
|
|
mp := acquirem()
|
2014-09-03 11:35:22 -04:00
|
|
|
onM(signal_recv_m)
|
2014-08-24 11:50:37 +04:00
|
|
|
ok := mp.scalararg[0] != 0
|
|
|
|
|
m = uint32(mp.scalararg[1])
|
|
|
|
|
releasem(mp)
|
|
|
|
|
if ok {
|
|
|
|
|
return
|
|
|
|
|
}
|
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.
Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).
LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
2014-08-27 21:59:49 -04:00
|
|
|
notetsleepg(&signote, -1)
|
|
|
|
|
noteclear(&signote)
|
2014-08-24 11:50:37 +04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func signal_enable(s uint32) {
|
|
|
|
|
mp := acquirem()
|
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.
Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).
LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
2014-08-27 21:59:49 -04:00
|
|
|
mp.scalararg[0] = uintptr(s)
|
2014-09-03 11:35:22 -04:00
|
|
|
onM(signal_enable_m)
|
2014-08-24 11:50:37 +04:00
|
|
|
releasem(mp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func signal_disable(s uint32) {
|
|
|
|
|
mp := acquirem()
|
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.
Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).
LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
2014-08-27 21:59:49 -04:00
|
|
|
mp.scalararg[0] = uintptr(s)
|
2014-09-03 11:35:22 -04:00
|
|
|
onM(signal_disable_m)
|
2014-08-24 11:50:37 +04:00
|
|
|
releasem(mp)
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-03 11:35:22 -04:00
|
|
|
func signal_recv_m()
|
|
|
|
|
func signal_enable_m()
|
|
|
|
|
func signal_disable_m()
|