gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/kernel/futex/BUILD (about) 1 load("//pkg/sync/locking:locking.bzl", "declare_mutex") 2 load("//tools:defs.bzl", "go_library", "go_test") 3 load("//tools/go_generics:defs.bzl", "go_template_instance") 4 5 package( 6 default_applicable_licenses = ["//:license"], 7 licenses = ["notice"], 8 ) 9 10 declare_mutex( 11 name = "futex_mutex", 12 out = "futex_mutex.go", 13 nested_lock_names = [ 14 "b", 15 ], 16 package = "futex", 17 prefix = "futexBucket", 18 ) 19 20 go_template_instance( 21 name = "atomicptr_bucket", 22 out = "atomicptr_bucket_unsafe.go", 23 package = "futex", 24 suffix = "Bucket", 25 template = "//pkg/sync/atomicptr:generic_atomicptr", 26 types = { 27 "Value": "bucket", 28 }, 29 ) 30 31 go_template_instance( 32 name = "waiter_list", 33 out = "waiter_list.go", 34 package = "futex", 35 prefix = "waiter", 36 template = "//pkg/ilist:generic_list", 37 types = { 38 "Element": "*Waiter", 39 "Linker": "*Waiter", 40 }, 41 ) 42 43 go_library( 44 name = "futex", 45 srcs = [ 46 "atomicptr_bucket_unsafe.go", 47 "futex.go", 48 "futex_mutex.go", 49 "waiter_list.go", 50 ], 51 visibility = ["//pkg/sentry:internal"], 52 deps = [ 53 "//pkg/abi/linux", 54 "//pkg/context", 55 "//pkg/errors/linuxerr", 56 "//pkg/hostarch", 57 "//pkg/log", 58 "//pkg/sentry/memmap", 59 "//pkg/sync", 60 "//pkg/sync/locking", 61 "//pkg/usermem", 62 ], 63 ) 64 65 go_test( 66 name = "futex_test", 67 size = "small", 68 srcs = ["futex_test.go"], 69 library = ":futex", 70 deps = [ 71 "//pkg/atomicbitops", 72 "//pkg/context", 73 "//pkg/errors/linuxerr", 74 "//pkg/hostarch", 75 "//pkg/sync", 76 ], 77 )