internal/fakecgo: disable race in fakecgo (#319)
Closes #318
- commit
- 9751c4bdbded665e90534280ade84089302ed875
- author
- TotallyGamerJet · · 2025-05-20 12:28 UTC
- committer
- GitHub · · 2025-05-20 12:28 UTC
- parent
- 05b0c8f
- signature
- GPG Unverified
B5690EEEBB952194The key is unknown - refs
- tag: v0.9.0-alpha.6
4 files · +33 -2
M .github/workflows/test.yml +8 -2
| @@ -136,10 +136,16 @@ jobs: | |||
| 136 | 136 | sudo apt-get install g++-multilib | |
| 137 | 137 | env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./... | |
| 138 | 138 | ||
| 139 | - | - name: go test race | |
| 139 | + | - name: go test race (no Cgo) | |
| 140 | + | if: ${{ runner.os == 'macOS' && !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }} | |
| 141 | + | run: | | |
| 142 | + | # -race usually requires Cgo, but macOS is an exception. See https://go.dev/doc/articles/race_detector#Requirements | |
| 143 | + | env CGO_ENABLED=0 go test -race -shuffle=on -v -count=10 ./... | |
| 144 | + | ||
| 145 | + | - name: go test race (Cgo) | |
| 140 | 146 | if: ${{ !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }} | |
| 141 | 147 | run: | | |
| 142 | - | go test -race -shuffle=on -v -count=10 ./... | |
| 148 | + | env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./... | |
| 143 | 149 | ||
| 144 | 150 | bsd: | |
| 145 | 151 | strategy: | |
| @@ -136,10 +136,16 @@ jobs: | |||||
| 136 | sudo apt-get install g++-multilib | 136 | sudo apt-get install g++-multilib | ||
| 137 | env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./... | 137 | env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./... | ||
| 138 | 138 | ||||
| 139 | - | - name: go test race | 139 | + | - name: go test race (no Cgo) |
| 140 | + | if: ${{ runner.os == 'macOS' && !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }} | |||
| 141 | + | run: | | |||
| 142 | + | # -race usually requires Cgo, but macOS is an exception. See https://go.dev/doc/articles/race_detector#Requirements | |||
| 143 | + | env CGO_ENABLED=0 go test -race -shuffle=on -v -count=10 ./... | |||
| 144 | + | ||||
| 145 | + | - name: go test race (Cgo) | |||
| 140 | if: ${{ !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }} | 146 | if: ${{ !startsWith(matrix.go, '1.18.') && !startsWith(matrix.go, '1.19.') }} | ||
| 141 | run: | | 147 | run: | | ||
| 142 | - | go test -race -shuffle=on -v -count=10 ./... | 148 | + | env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./... |
| 143 | 149 | ||||
| 144 | bsd: | 150 | bsd: | ||
| 145 | strategy: | 151 | strategy: | ||
M internal/fakecgo/gen.go +1 -0
| @@ -37,6 +37,7 @@ func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr | |||
| 37 | 37 | ||
| 38 | 38 | {{ range . -}} | |
| 39 | 39 | //go:nosplit | |
| 40 | + | //go:norace | |
| 40 | 41 | func {{.Name}}( | |
| 41 | 42 | {{- range .Args -}} | |
| 42 | 43 | {{- if .Name -}} | |
| @@ -37,6 +37,7 @@ func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr | |||||
| 37 | 37 | ||||
| 38 | {{ range . -}} | 38 | {{ range . -}} | ||
| 39 | //go:nosplit | 39 | //go:nosplit | ||
| 40 | + | //go:norace | |||
| 40 | func {{.Name}}( | 41 | func {{.Name}}( | ||
| 41 | {{- range .Args -}} | 42 | {{- range .Args -}} | ||
| 42 | {{- if .Name -}} | 43 | {{- if .Name -}} | ||
M internal/fakecgo/go_libinit.go +3 -0
| @@ -19,6 +19,7 @@ var ( | |||
| 19 | 19 | ) | |
| 20 | 20 | ||
| 21 | 21 | //go:nosplit | |
| 22 | + | //go:norace | |
| 22 | 23 | func x_cgo_notify_runtime_init_done() { | |
| 23 | 24 | pthread_mutex_lock(&runtime_init_mu) | |
| 24 | 25 | runtime_init_done = 1 | |
| @@ -28,6 +29,8 @@ func x_cgo_notify_runtime_init_done() { | |||
| 28 | 29 | ||
| 29 | 30 | // Store the g into a thread-specific value associated with the pthread key pthread_g. | |
| 30 | 31 | // And pthread_key_destructor will dropm when the thread is exiting. | |
| 32 | + | // | |
| 33 | + | //go:norace | |
| 31 | 34 | func x_cgo_bindm(g unsafe.Pointer) { | |
| 32 | 35 | // We assume this will always succeed, otherwise, there might be extra M leaking, | |
| 33 | 36 | // when a C thread exits after a cgo call. | |
| @@ -19,6 +19,7 @@ var ( | |||||
| 19 | ) | 19 | ) | ||
| 20 | 20 | ||||
| 21 | //go:nosplit | 21 | //go:nosplit | ||
| 22 | + | //go:norace | |||
| 22 | func x_cgo_notify_runtime_init_done() { | 23 | func x_cgo_notify_runtime_init_done() { | ||
| 23 | pthread_mutex_lock(&runtime_init_mu) | 24 | pthread_mutex_lock(&runtime_init_mu) | ||
| 24 | runtime_init_done = 1 | 25 | runtime_init_done = 1 | ||
| @@ -28,6 +29,8 @@ func x_cgo_notify_runtime_init_done() { | |||||
| 28 | 29 | ||||
| 29 | // Store the g into a thread-specific value associated with the pthread key pthread_g. | 30 | // Store the g into a thread-specific value associated with the pthread key pthread_g. | ||
| 30 | // And pthread_key_destructor will dropm when the thread is exiting. | 31 | // And pthread_key_destructor will dropm when the thread is exiting. | ||
| 32 | + | // | |||
| 33 | + | //go:norace | |||
| 31 | func x_cgo_bindm(g unsafe.Pointer) { | 34 | func x_cgo_bindm(g unsafe.Pointer) { | ||
| 32 | // We assume this will always succeed, otherwise, there might be extra M leaking, | 35 | // We assume this will always succeed, otherwise, there might be extra M leaking, | ||
| 33 | // when a C thread exits after a cgo call. | 36 | // when a C thread exits after a cgo call. | ||
M internal/fakecgo/symbols.go +21 -0
| @@ -19,6 +19,7 @@ func setg_trampoline(setg uintptr, G uintptr) | |||
| 19 | 19 | func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr | |
| 20 | 20 | ||
| 21 | 21 | //go:nosplit | |
| 22 | + | //go:norace | |
| 22 | 23 | func malloc(size uintptr) unsafe.Pointer { | |
| 23 | 24 | ret := call5(mallocABI0, uintptr(size), 0, 0, 0, 0) | |
| 24 | 25 | // this indirection is to avoid go vet complaining about possible misuse of unsafe.Pointer | |
| @@ -26,101 +27,121 @@ func malloc(size uintptr) unsafe.Pointer { | |||
| 26 | 27 | } | |
| 27 | 28 | ||
| 28 | 29 | //go:nosplit | |
| 30 | + | //go:norace | |
| 29 | 31 | func free(ptr unsafe.Pointer) { | |
| 30 | 32 | call5(freeABI0, uintptr(ptr), 0, 0, 0, 0) | |
| 31 | 33 | } | |
| 32 | 34 | ||
| 33 | 35 | //go:nosplit | |
| 36 | + | //go:norace | |
| 34 | 37 | func setenv(name *byte, value *byte, overwrite int32) int32 { | |
| 35 | 38 | return int32(call5(setenvABI0, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), uintptr(overwrite), 0, 0)) | |
| 36 | 39 | } | |
| 37 | 40 | ||
| 38 | 41 | //go:nosplit | |
| 42 | + | //go:norace | |
| 39 | 43 | func unsetenv(name *byte) int32 { | |
| 40 | 44 | return int32(call5(unsetenvABI0, uintptr(unsafe.Pointer(name)), 0, 0, 0, 0)) | |
| 41 | 45 | } | |
| 42 | 46 | ||
| 43 | 47 | //go:nosplit | |
| 48 | + | //go:norace | |
| 44 | 49 | func sigfillset(set *sigset_t) int32 { | |
| 45 | 50 | return int32(call5(sigfillsetABI0, uintptr(unsafe.Pointer(set)), 0, 0, 0, 0)) | |
| 46 | 51 | } | |
| 47 | 52 | ||
| 48 | 53 | //go:nosplit | |
| 54 | + | //go:norace | |
| 49 | 55 | func nanosleep(ts *syscall.Timespec, rem *syscall.Timespec) int32 { | |
| 50 | 56 | return int32(call5(nanosleepABI0, uintptr(unsafe.Pointer(ts)), uintptr(unsafe.Pointer(rem)), 0, 0, 0)) | |
| 51 | 57 | } | |
| 52 | 58 | ||
| 53 | 59 | //go:nosplit | |
| 60 | + | //go:norace | |
| 54 | 61 | func abort() { | |
| 55 | 62 | call5(abortABI0, 0, 0, 0, 0, 0) | |
| 56 | 63 | } | |
| 57 | 64 | ||
| 58 | 65 | //go:nosplit | |
| 66 | + | //go:norace | |
| 59 | 67 | func sigaltstack(ss *stack_t, old_ss *stack_t) int32 { | |
| 60 | 68 | return int32(call5(sigaltstackABI0, uintptr(unsafe.Pointer(ss)), uintptr(unsafe.Pointer(old_ss)), 0, 0, 0)) | |
| 61 | 69 | } | |
| 62 | 70 | ||
| 63 | 71 | //go:nosplit | |
| 72 | + | //go:norace | |
| 64 | 73 | func pthread_attr_init(attr *pthread_attr_t) int32 { | |
| 65 | 74 | return int32(call5(pthread_attr_initABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) | |
| 66 | 75 | } | |
| 67 | 76 | ||
| 68 | 77 | //go:nosplit | |
| 78 | + | //go:norace | |
| 69 | 79 | func pthread_create(thread *pthread_t, attr *pthread_attr_t, start unsafe.Pointer, arg unsafe.Pointer) int32 { | |
| 70 | 80 | return int32(call5(pthread_createABI0, uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(attr)), uintptr(start), uintptr(arg), 0)) | |
| 71 | 81 | } | |
| 72 | 82 | ||
| 73 | 83 | //go:nosplit | |
| 84 | + | //go:norace | |
| 74 | 85 | func pthread_detach(thread pthread_t) int32 { | |
| 75 | 86 | return int32(call5(pthread_detachABI0, uintptr(thread), 0, 0, 0, 0)) | |
| 76 | 87 | } | |
| 77 | 88 | ||
| 78 | 89 | //go:nosplit | |
| 90 | + | //go:norace | |
| 79 | 91 | func pthread_sigmask(how sighow, ign *sigset_t, oset *sigset_t) int32 { | |
| 80 | 92 | return int32(call5(pthread_sigmaskABI0, uintptr(how), uintptr(unsafe.Pointer(ign)), uintptr(unsafe.Pointer(oset)), 0, 0)) | |
| 81 | 93 | } | |
| 82 | 94 | ||
| 83 | 95 | //go:nosplit | |
| 96 | + | //go:norace | |
| 84 | 97 | func pthread_self() pthread_t { | |
| 85 | 98 | return pthread_t(call5(pthread_selfABI0, 0, 0, 0, 0, 0)) | |
| 86 | 99 | } | |
| 87 | 100 | ||
| 88 | 101 | //go:nosplit | |
| 102 | + | //go:norace | |
| 89 | 103 | func pthread_get_stacksize_np(thread pthread_t) size_t { | |
| 90 | 104 | return size_t(call5(pthread_get_stacksize_npABI0, uintptr(thread), 0, 0, 0, 0)) | |
| 91 | 105 | } | |
| 92 | 106 | ||
| 93 | 107 | //go:nosplit | |
| 108 | + | //go:norace | |
| 94 | 109 | func pthread_attr_getstacksize(attr *pthread_attr_t, stacksize *size_t) int32 { | |
| 95 | 110 | return int32(call5(pthread_attr_getstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(unsafe.Pointer(stacksize)), 0, 0, 0)) | |
| 96 | 111 | } | |
| 97 | 112 | ||
| 98 | 113 | //go:nosplit | |
| 114 | + | //go:norace | |
| 99 | 115 | func pthread_attr_setstacksize(attr *pthread_attr_t, size size_t) int32 { | |
| 100 | 116 | return int32(call5(pthread_attr_setstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(size), 0, 0, 0)) | |
| 101 | 117 | } | |
| 102 | 118 | ||
| 103 | 119 | //go:nosplit | |
| 120 | + | //go:norace | |
| 104 | 121 | func pthread_attr_destroy(attr *pthread_attr_t) int32 { | |
| 105 | 122 | return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) | |
| 106 | 123 | } | |
| 107 | 124 | ||
| 108 | 125 | //go:nosplit | |
| 126 | + | //go:norace | |
| 109 | 127 | func pthread_mutex_lock(mutex *pthread_mutex_t) int32 { | |
| 110 | 128 | return int32(call5(pthread_mutex_lockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) | |
| 111 | 129 | } | |
| 112 | 130 | ||
| 113 | 131 | //go:nosplit | |
| 132 | + | //go:norace | |
| 114 | 133 | func pthread_mutex_unlock(mutex *pthread_mutex_t) int32 { | |
| 115 | 134 | return int32(call5(pthread_mutex_unlockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) | |
| 116 | 135 | } | |
| 117 | 136 | ||
| 118 | 137 | //go:nosplit | |
| 138 | + | //go:norace | |
| 119 | 139 | func pthread_cond_broadcast(cond *pthread_cond_t) int32 { | |
| 120 | 140 | return int32(call5(pthread_cond_broadcastABI0, uintptr(unsafe.Pointer(cond)), 0, 0, 0, 0)) | |
| 121 | 141 | } | |
| 122 | 142 | ||
| 123 | 143 | //go:nosplit | |
| 144 | + | //go:norace | |
| 124 | 145 | func pthread_setspecific(key pthread_key_t, value unsafe.Pointer) int32 { | |
| 125 | 146 | return int32(call5(pthread_setspecificABI0, uintptr(key), uintptr(value), 0, 0, 0)) | |
| 126 | 147 | } | |
| @@ -19,6 +19,7 @@ func setg_trampoline(setg uintptr, G uintptr) | |||||
| 19 | func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr | 19 | func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr | ||
| 20 | 20 | ||||
| 21 | //go:nosplit | 21 | //go:nosplit | ||
| 22 | + | //go:norace | |||
| 22 | func malloc(size uintptr) unsafe.Pointer { | 23 | func malloc(size uintptr) unsafe.Pointer { | ||
| 23 | ret := call5(mallocABI0, uintptr(size), 0, 0, 0, 0) | 24 | ret := call5(mallocABI0, uintptr(size), 0, 0, 0, 0) | ||
| 24 | // this indirection is to avoid go vet complaining about possible misuse of unsafe.Pointer | 25 | // this indirection is to avoid go vet complaining about possible misuse of unsafe.Pointer | ||
| @@ -26,101 +27,121 @@ func malloc(size uintptr) unsafe.Pointer { | |||||
| 26 | } | 27 | } | ||
| 27 | 28 | ||||
| 28 | //go:nosplit | 29 | //go:nosplit | ||
| 30 | + | //go:norace | |||
| 29 | func free(ptr unsafe.Pointer) { | 31 | func free(ptr unsafe.Pointer) { | ||
| 30 | call5(freeABI0, uintptr(ptr), 0, 0, 0, 0) | 32 | call5(freeABI0, uintptr(ptr), 0, 0, 0, 0) | ||
| 31 | } | 33 | } | ||
| 32 | 34 | ||||
| 33 | //go:nosplit | 35 | //go:nosplit | ||
| 36 | + | //go:norace | |||
| 34 | func setenv(name *byte, value *byte, overwrite int32) int32 { | 37 | func setenv(name *byte, value *byte, overwrite int32) int32 { | ||
| 35 | return int32(call5(setenvABI0, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), uintptr(overwrite), 0, 0)) | 38 | return int32(call5(setenvABI0, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), uintptr(overwrite), 0, 0)) | ||
| 36 | } | 39 | } | ||
| 37 | 40 | ||||
| 38 | //go:nosplit | 41 | //go:nosplit | ||
| 42 | + | //go:norace | |||
| 39 | func unsetenv(name *byte) int32 { | 43 | func unsetenv(name *byte) int32 { | ||
| 40 | return int32(call5(unsetenvABI0, uintptr(unsafe.Pointer(name)), 0, 0, 0, 0)) | 44 | return int32(call5(unsetenvABI0, uintptr(unsafe.Pointer(name)), 0, 0, 0, 0)) | ||
| 41 | } | 45 | } | ||
| 42 | 46 | ||||
| 43 | //go:nosplit | 47 | //go:nosplit | ||
| 48 | + | //go:norace | |||
| 44 | func sigfillset(set *sigset_t) int32 { | 49 | func sigfillset(set *sigset_t) int32 { | ||
| 45 | return int32(call5(sigfillsetABI0, uintptr(unsafe.Pointer(set)), 0, 0, 0, 0)) | 50 | return int32(call5(sigfillsetABI0, uintptr(unsafe.Pointer(set)), 0, 0, 0, 0)) | ||
| 46 | } | 51 | } | ||
| 47 | 52 | ||||
| 48 | //go:nosplit | 53 | //go:nosplit | ||
| 54 | + | //go:norace | |||
| 49 | func nanosleep(ts *syscall.Timespec, rem *syscall.Timespec) int32 { | 55 | func nanosleep(ts *syscall.Timespec, rem *syscall.Timespec) int32 { | ||
| 50 | return int32(call5(nanosleepABI0, uintptr(unsafe.Pointer(ts)), uintptr(unsafe.Pointer(rem)), 0, 0, 0)) | 56 | return int32(call5(nanosleepABI0, uintptr(unsafe.Pointer(ts)), uintptr(unsafe.Pointer(rem)), 0, 0, 0)) | ||
| 51 | } | 57 | } | ||
| 52 | 58 | ||||
| 53 | //go:nosplit | 59 | //go:nosplit | ||
| 60 | + | //go:norace | |||
| 54 | func abort() { | 61 | func abort() { | ||
| 55 | call5(abortABI0, 0, 0, 0, 0, 0) | 62 | call5(abortABI0, 0, 0, 0, 0, 0) | ||
| 56 | } | 63 | } | ||
| 57 | 64 | ||||
| 58 | //go:nosplit | 65 | //go:nosplit | ||
| 66 | + | //go:norace | |||
| 59 | func sigaltstack(ss *stack_t, old_ss *stack_t) int32 { | 67 | func sigaltstack(ss *stack_t, old_ss *stack_t) int32 { | ||
| 60 | return int32(call5(sigaltstackABI0, uintptr(unsafe.Pointer(ss)), uintptr(unsafe.Pointer(old_ss)), 0, 0, 0)) | 68 | return int32(call5(sigaltstackABI0, uintptr(unsafe.Pointer(ss)), uintptr(unsafe.Pointer(old_ss)), 0, 0, 0)) | ||
| 61 | } | 69 | } | ||
| 62 | 70 | ||||
| 63 | //go:nosplit | 71 | //go:nosplit | ||
| 72 | + | //go:norace | |||
| 64 | func pthread_attr_init(attr *pthread_attr_t) int32 { | 73 | func pthread_attr_init(attr *pthread_attr_t) int32 { | ||
| 65 | return int32(call5(pthread_attr_initABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) | 74 | return int32(call5(pthread_attr_initABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) | ||
| 66 | } | 75 | } | ||
| 67 | 76 | ||||
| 68 | //go:nosplit | 77 | //go:nosplit | ||
| 78 | + | //go:norace | |||
| 69 | func pthread_create(thread *pthread_t, attr *pthread_attr_t, start unsafe.Pointer, arg unsafe.Pointer) int32 { | 79 | func pthread_create(thread *pthread_t, attr *pthread_attr_t, start unsafe.Pointer, arg unsafe.Pointer) int32 { | ||
| 70 | return int32(call5(pthread_createABI0, uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(attr)), uintptr(start), uintptr(arg), 0)) | 80 | return int32(call5(pthread_createABI0, uintptr(unsafe.Pointer(thread)), uintptr(unsafe.Pointer(attr)), uintptr(start), uintptr(arg), 0)) | ||
| 71 | } | 81 | } | ||
| 72 | 82 | ||||
| 73 | //go:nosplit | 83 | //go:nosplit | ||
| 84 | + | //go:norace | |||
| 74 | func pthread_detach(thread pthread_t) int32 { | 85 | func pthread_detach(thread pthread_t) int32 { | ||
| 75 | return int32(call5(pthread_detachABI0, uintptr(thread), 0, 0, 0, 0)) | 86 | return int32(call5(pthread_detachABI0, uintptr(thread), 0, 0, 0, 0)) | ||
| 76 | } | 87 | } | ||
| 77 | 88 | ||||
| 78 | //go:nosplit | 89 | //go:nosplit | ||
| 90 | + | //go:norace | |||
| 79 | func pthread_sigmask(how sighow, ign *sigset_t, oset *sigset_t) int32 { | 91 | func pthread_sigmask(how sighow, ign *sigset_t, oset *sigset_t) int32 { | ||
| 80 | return int32(call5(pthread_sigmaskABI0, uintptr(how), uintptr(unsafe.Pointer(ign)), uintptr(unsafe.Pointer(oset)), 0, 0)) | 92 | return int32(call5(pthread_sigmaskABI0, uintptr(how), uintptr(unsafe.Pointer(ign)), uintptr(unsafe.Pointer(oset)), 0, 0)) | ||
| 81 | } | 93 | } | ||
| 82 | 94 | ||||
| 83 | //go:nosplit | 95 | //go:nosplit | ||
| 96 | + | //go:norace | |||
| 84 | func pthread_self() pthread_t { | 97 | func pthread_self() pthread_t { | ||
| 85 | return pthread_t(call5(pthread_selfABI0, 0, 0, 0, 0, 0)) | 98 | return pthread_t(call5(pthread_selfABI0, 0, 0, 0, 0, 0)) | ||
| 86 | } | 99 | } | ||
| 87 | 100 | ||||
| 88 | //go:nosplit | 101 | //go:nosplit | ||
| 102 | + | //go:norace | |||
| 89 | func pthread_get_stacksize_np(thread pthread_t) size_t { | 103 | func pthread_get_stacksize_np(thread pthread_t) size_t { | ||
| 90 | return size_t(call5(pthread_get_stacksize_npABI0, uintptr(thread), 0, 0, 0, 0)) | 104 | return size_t(call5(pthread_get_stacksize_npABI0, uintptr(thread), 0, 0, 0, 0)) | ||
| 91 | } | 105 | } | ||
| 92 | 106 | ||||
| 93 | //go:nosplit | 107 | //go:nosplit | ||
| 108 | + | //go:norace | |||
| 94 | func pthread_attr_getstacksize(attr *pthread_attr_t, stacksize *size_t) int32 { | 109 | func pthread_attr_getstacksize(attr *pthread_attr_t, stacksize *size_t) int32 { | ||
| 95 | return int32(call5(pthread_attr_getstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(unsafe.Pointer(stacksize)), 0, 0, 0)) | 110 | return int32(call5(pthread_attr_getstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(unsafe.Pointer(stacksize)), 0, 0, 0)) | ||
| 96 | } | 111 | } | ||
| 97 | 112 | ||||
| 98 | //go:nosplit | 113 | //go:nosplit | ||
| 114 | + | //go:norace | |||
| 99 | func pthread_attr_setstacksize(attr *pthread_attr_t, size size_t) int32 { | 115 | func pthread_attr_setstacksize(attr *pthread_attr_t, size size_t) int32 { | ||
| 100 | return int32(call5(pthread_attr_setstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(size), 0, 0, 0)) | 116 | return int32(call5(pthread_attr_setstacksizeABI0, uintptr(unsafe.Pointer(attr)), uintptr(size), 0, 0, 0)) | ||
| 101 | } | 117 | } | ||
| 102 | 118 | ||||
| 103 | //go:nosplit | 119 | //go:nosplit | ||
| 120 | + | //go:norace | |||
| 104 | func pthread_attr_destroy(attr *pthread_attr_t) int32 { | 121 | func pthread_attr_destroy(attr *pthread_attr_t) int32 { | ||
| 105 | return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) | 122 | return int32(call5(pthread_attr_destroyABI0, uintptr(unsafe.Pointer(attr)), 0, 0, 0, 0)) | ||
| 106 | } | 123 | } | ||
| 107 | 124 | ||||
| 108 | //go:nosplit | 125 | //go:nosplit | ||
| 126 | + | //go:norace | |||
| 109 | func pthread_mutex_lock(mutex *pthread_mutex_t) int32 { | 127 | func pthread_mutex_lock(mutex *pthread_mutex_t) int32 { | ||
| 110 | return int32(call5(pthread_mutex_lockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) | 128 | return int32(call5(pthread_mutex_lockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) | ||
| 111 | } | 129 | } | ||
| 112 | 130 | ||||
| 113 | //go:nosplit | 131 | //go:nosplit | ||
| 132 | + | //go:norace | |||
| 114 | func pthread_mutex_unlock(mutex *pthread_mutex_t) int32 { | 133 | func pthread_mutex_unlock(mutex *pthread_mutex_t) int32 { | ||
| 115 | return int32(call5(pthread_mutex_unlockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) | 134 | return int32(call5(pthread_mutex_unlockABI0, uintptr(unsafe.Pointer(mutex)), 0, 0, 0, 0)) | ||
| 116 | } | 135 | } | ||
| 117 | 136 | ||||
| 118 | //go:nosplit | 137 | //go:nosplit | ||
| 138 | + | //go:norace | |||
| 119 | func pthread_cond_broadcast(cond *pthread_cond_t) int32 { | 139 | func pthread_cond_broadcast(cond *pthread_cond_t) int32 { | ||
| 120 | return int32(call5(pthread_cond_broadcastABI0, uintptr(unsafe.Pointer(cond)), 0, 0, 0, 0)) | 140 | return int32(call5(pthread_cond_broadcastABI0, uintptr(unsafe.Pointer(cond)), 0, 0, 0, 0)) | ||
| 121 | } | 141 | } | ||
| 122 | 142 | ||||
| 123 | //go:nosplit | 143 | //go:nosplit | ||
| 144 | + | //go:norace | |||
| 124 | func pthread_setspecific(key pthread_key_t, value unsafe.Pointer) int32 { | 145 | func pthread_setspecific(key pthread_key_t, value unsafe.Pointer) int32 { | ||
| 125 | return int32(call5(pthread_setspecificABI0, uintptr(key), uintptr(value), 0, 0, 0)) | 146 | return int32(call5(pthread_setspecificABI0, uintptr(key), uintptr(value), 0, 0, 0)) | ||
| 126 | } | 147 | } | ||