Skip to content

Commit 028bcd2

Browse files
psilva261rafael2k
authored andcommitted
improve flakiness of fs based tests
1 parent 53a9389 commit 028bcd2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/syscall/pwd_plan9.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ var (
2929
// rescheduling on a different thread (potentially with a different
3030
// working directory) before the syscall is executed.
3131
func Fixwd() {
32+
runtime.LockOSThread()
33+
defer runtime.UnlockOSThread()
3234
wdmu.Lock()
3335
defer wdmu.Unlock()
3436
fixwdLocked()
@@ -72,6 +74,8 @@ func getwd() (wd string, err error) {
7274
}
7375

7476
func Getwd() (wd string, err error) {
77+
runtime.LockOSThread()
78+
defer runtime.UnlockOSThread()
7579
wdmu.Lock()
7680
defer wdmu.Unlock()
7781

0 commit comments

Comments
 (0)