File tree 4 files changed +64
-1
lines changed
4 files changed +64
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Ubuntu 18.04 CI (GCC 7) with Thread Sanitizer
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
10
+
11
+ jobs :
12
+ ubuntu-build :
13
+ runs-on : ubuntu-18.04
14
+ steps :
15
+ - uses : actions/checkout@v2
16
+ - uses : actions/cache@v2
17
+ with :
18
+ path : dependencies/.cache
19
+ key : ${{ hashFiles('dependencies/CMakeLists.txt') }}
20
+ - name : Use cmake
21
+ run : |
22
+ mkdir build &&
23
+ cd build &&
24
+ cmake -DSIMDJSON_SANITIZE_THREADS=ON .. &&
25
+ cmake --build . --target document_stream_tests --target parse_many_test &&
26
+ ctest --output-on-failure -R parse_many_test &&
27
+ ctest --output-on-failure -R document_stream_tests
Original file line number Diff line number Diff line change
1
+ name : Ubuntu 20.04 CI (GCC 9) with Thread Sanitizer
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
10
+
11
+ jobs :
12
+ ubuntu-build :
13
+ runs-on : ubuntu-20.04
14
+ steps :
15
+ - uses : actions/checkout@v2
16
+ - uses : actions/cache@v2
17
+ with :
18
+ path : dependencies/.cache
19
+ key : ${{ hashFiles('dependencies/CMakeLists.txt') }}
20
+ - name : Use cmake
21
+ run : |
22
+ mkdir build &&
23
+ cd build &&
24
+ cmake -DSIMDJSON_SANITIZE_THREADS=ON .. &&
25
+ cmake --build . --target document_stream_tests --target parse_many_test &&
26
+ ctest --output-on-failure -R parse_many_test &&
27
+ ctest --output-on-failure -R document_stream_tests
Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ if(SIMDJSON_SANITIZE)
27
27
endif ()
28
28
endif ()
29
29
30
+ if (SIMDJSON_SANITIZE_THREADS)
31
+ target_compile_options (simdjson-flags INTERFACE -fsanitize=thread -fsanitize=undefined -fno-sanitize-recover=all )
32
+ target_link_libraries (simdjson-flags INTERFACE -fsanitize=thread -fsanitize=undefined -fno-sanitize-recover=all )
33
+
34
+ # Ubuntu bug for GCC 5.0+ (safe for all versions)
35
+ if (CMAKE_COMPILER_IS_GNUCC)
36
+ target_link_libraries (simdjson-flags INTERFACE -fuse-ld=gold)
37
+ endif ()
38
+ endif ()
30
39
31
40
if (NOT CMAKE_BUILD_TYPE )
32
41
message (STATUS "No build type selected, default to Release" )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ inline void stage1_worker::start_thread() {
24
24
return ; // This should never happen but we never want to create more than one thread.
25
25
}
26
26
thread = std::thread ([this ]{
27
- while (can_work ) {
27
+ while (true ) {
28
28
std::unique_lock<std::mutex> thread_lock (locking_mutex);
29
29
cond_var.wait (thread_lock, [this ]{return has_work || !can_work;});
30
30
if (!can_work) {
You can’t perform that action at this time.
0 commit comments