github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sentry/kernel/futex/BUILD (about)

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(licenses = ["notice"])
     5  
     6  go_template_instance(
     7      name = "atomicptr_bucket",
     8      out = "atomicptr_bucket_unsafe.go",
     9      package = "futex",
    10      suffix = "Bucket",
    11      template = "//pkg/sync/atomicptr:generic_atomicptr",
    12      types = {
    13          "Value": "bucket",
    14      },
    15  )
    16  
    17  go_template_instance(
    18      name = "waiter_list",
    19      out = "waiter_list.go",
    20      package = "futex",
    21      prefix = "waiter",
    22      template = "//pkg/ilist:generic_list",
    23      types = {
    24          "Element": "*Waiter",
    25          "Linker": "*Waiter",
    26      },
    27  )
    28  
    29  go_library(
    30      name = "futex",
    31      srcs = [
    32          "atomicptr_bucket_unsafe.go",
    33          "futex.go",
    34          "waiter_list.go",
    35      ],
    36      visibility = ["//pkg/sentry:internal"],
    37      deps = [
    38          "//pkg/abi/linux",
    39          "//pkg/context",
    40          "//pkg/errors/linuxerr",
    41          "//pkg/hostarch",
    42          "//pkg/log",
    43          "//pkg/sentry/memmap",
    44          "//pkg/sync",
    45          "//pkg/syserror",
    46          "//pkg/usermem",
    47      ],
    48  )
    49  
    50  go_test(
    51      name = "futex_test",
    52      size = "small",
    53      srcs = ["futex_test.go"],
    54      library = ":futex",
    55      deps = [
    56          "//pkg/context",
    57          "//pkg/errors/linuxerr",
    58          "//pkg/hostarch",
    59          "//pkg/sync",
    60      ],
    61  )