Files

78 lines
1.6 KiB
Python
Raw Permalink Normal View History

load("//pkg/sync/locking:locking.bzl", "declare_mutex")
2020-01-27 10:04:07 -08:00
load("//tools:defs.bzl", "go_library", "go_test")
2018-04-27 10:37:02 -07:00
load("//tools/go_generics:defs.bzl", "go_template_instance")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
declare_mutex(
2022-05-19 18:27:34 -07:00
name = "futex_mutex",
out = "futex_mutex.go",
nested_lock_names = [
"b",
],
2022-05-19 18:27:34 -07:00
package = "futex",
prefix = "futexBucket",
)
2018-10-08 10:19:27 -07:00
go_template_instance(
name = "atomicptr_bucket",
2019-07-09 16:42:54 -07:00
out = "atomicptr_bucket_unsafe.go",
2018-10-08 10:19:27 -07:00
package = "futex",
suffix = "Bucket",
2021-06-01 17:45:10 -07:00
template = "//pkg/sync/atomicptr:generic_atomicptr",
2018-10-08 10:19:27 -07:00
types = {
"Value": "bucket",
},
)
2018-04-27 10:37:02 -07:00
go_template_instance(
name = "waiter_list",
out = "waiter_list.go",
package = "futex",
prefix = "waiter",
template = "//pkg/ilist:generic_list",
types = {
2018-09-04 09:18:00 -07:00
"Element": "*Waiter",
2018-04-27 10:37:02 -07:00
"Linker": "*Waiter",
},
)
2018-08-01 19:56:12 -07:00
go_library(
name = "futex",
srcs = [
2019-07-09 16:42:54 -07:00
"atomicptr_bucket_unsafe.go",
2018-08-01 19:56:12 -07:00
"futex.go",
2022-05-19 18:27:34 -07:00
"futex_mutex.go",
2018-08-01 19:56:12 -07:00
"waiter_list.go",
],
2018-04-27 10:37:02 -07:00
visibility = ["//pkg/sentry:internal"],
2018-10-08 10:19:27 -07:00
deps = [
2018-11-16 12:16:37 -08:00
"//pkg/abi/linux",
2020-01-27 15:17:58 -08:00
"//pkg/context",
"//pkg/errors/linuxerr",
2021-03-29 13:28:32 -07:00
"//pkg/hostarch",
2019-03-05 23:39:14 -08:00
"//pkg/log",
2018-10-08 10:19:27 -07:00
"//pkg/sentry/memmap",
2020-01-09 22:00:42 -08:00
"//pkg/sync",
2022-05-19 18:27:34 -07:00
"//pkg/sync/locking",
2020-01-27 15:17:58 -08:00
"//pkg/usermem",
2018-10-08 10:19:27 -07:00
],
2018-04-27 10:37:02 -07:00
)
go_test(
name = "futex_test",
size = "small",
srcs = ["futex_test.go"],
2020-01-27 10:04:07 -08:00
library = ":futex",
2020-01-09 22:00:42 -08:00
deps = [
"//pkg/atomicbitops",
"//pkg/context",
"//pkg/errors/linuxerr",
2021-03-29 13:28:32 -07:00
"//pkg/hostarch",
2020-01-09 22:00:42 -08:00
"//pkg/sync",
],
2018-04-27 10:37:02 -07:00
)