Skip to content

Commit 299794d

Browse files
authored
Make cereal thread safe by default (#178)
# Changes If you read the [Cereal library documentation](https://uscilab.github.io/cereal/thread_safety.html), you will be shocked that the default behavior for the library is to not have it run in a multithreaded manner. It apparently has a global variable that it uses to track information and it works nicely in a single threaded application, however in a mutlithreaded application is can be problematic. The changes here changes the default behavior so that this global variable is thread safe and doesn't cause any undefined behavior.
1 parent a977445 commit 299794d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

third_party/cereal.BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ package(
1515
cc_library(
1616
name = "cereal",
1717
hdrs = glob(["include/**"]),
18+
defines = ["CEREAL_THREAD_SAFE=1"],
1819
includes = ["include"],
20+
linkopts = ["-lpthread"],
1921
)

0 commit comments

Comments
 (0)