summaryrefslogtreecommitdiff
path: root/src/mongo/util/concurrency/SConscript
blob: acc81c451b47ca221ccfaa051c4419b8160d03b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# -*- mode: python -*-

Import("env")

env = env.Clone()

env.Library(
    target='thread_pool',
    source=[
        'thread_pool.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
)

env.Library(
    target='thread_pool_test_fixture',
    source=['thread_pool_test_common.cpp', 'thread_pool_test_fixture.cpp'],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/unittest/unittest',
    ],
)

env.Library(
    target='ticketholder',
    source=[
        'priority_ticketholder.cpp' if env.TargetOSIs('linux') else [],
        'semaphore_ticketholder.cpp',
        'ticket_pool.cpp' if env.TargetOSIs('linux') else [],
        'ticketholder.cpp',
    ],
    LIBDEPS_PRIVATE=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/storage/concurrency_adjustment_parameters',
        # TODO (SERVER-67104): Remove this dependency.
        '$BUILD_DIR/mongo/db/storage/storage_engine_feature_flags',
        '$BUILD_DIR/third_party/shim_boost',
        'admission_context',
    ],
)

env.Library(target='admission_context', source=['admission_context.cpp'],
            LIBDEPS=['$BUILD_DIR/mongo/base'])

env.Library(
    target='spin_lock',
    source=[
        "spin_lock.cpp",
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
)

env.CppUnitTest(
    target='util_concurrency_test',
    source=[
        'priority_ticketholder_test.cpp' if env.TargetOSIs('linux') else [],
        'semaphore_ticketholder_test.cpp',
        'spin_lock_test.cpp',
        'thread_pool_test.cpp',
        'ticketholder_test_fixture.cpp',
        'ticket_pool_test.cpp' if env.TargetOSIs('linux') else [],
        'with_lock_test.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/auth/authmocks',
        '$BUILD_DIR/mongo/db/service_context_test_fixture',
        'spin_lock',
        'thread_pool',
        'thread_pool_test_fixture',
        'ticketholder',
    ],
)

env.Benchmark(
    target='ticketholder_bm',
    source=[
        'ticketholder_bm.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/service_context',
        'ticketholder',
    ],
)