Skip to content

Commit 182dd87

Browse files
committed
remove old forklock stub and replace it with sync.RWMutex
Signed-off-by: leongross <[email protected]>
1 parent c3a2e91 commit 182dd87

File tree

1 file changed

+5
-26
lines changed

1 file changed

+5
-26
lines changed

src/syscall/forklock.go

+5-26
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
1-
//go:build tinygo && linux && !wasip1 && !wasip2 && !darwin && !baremetal
1+
//go:build tinygo && linux && !wasip1 && !wasip2 && tinygo.wasm && !wasm_unknown && !darwin && !baremetal && !nintendoswitch
22

33
package syscall
44

5-
// This is the original ForkLock:
6-
//
7-
// var ForkLock sync.RWMutex
8-
//
9-
// This requires importing sync, but importing sync causes an import loop:
10-
//
11-
// package tinygo.org/x/drivers/examples/net/tcpclient
12-
// imports bytes
13-
// imports io
14-
// imports sync
15-
// imports internal/task
16-
// imports runtime/interrupt
17-
// imports device/arm
18-
// imports syscall
19-
// imports sync: import cycle not allowed
20-
//
21-
// So for now, make our own stubbed-out ForkLock that doesn't use sync..
5+
import (
6+
"sync"
7+
)
228

23-
type forklock struct{}
24-
25-
func (f forklock) RLock() {}
26-
func (f forklock) RUnlock() {}
27-
28-
var ForkLock forklock
9+
var ForkLock sync.RWMutex
2910

3011
func CloseOnExec(fd int) {
3112
system.CloseOnExec(fd)
@@ -34,5 +15,3 @@ func CloseOnExec(fd int) {
3415
func SetNonblock(fd int, nonblocking bool) (err error) {
3516
return system.SetNonblock(fd, nonblocking)
3617
}
37-
38-
// type SysProcAttr struct{}

0 commit comments

Comments
 (0)