Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2015-03-16 22:48:56 +0300
committerAdam Langley <agl@google.com>2015-04-01 01:37:12 +0300
commitd7c5dfb233bfc0e5666efd343329fa94a3668818 (patch)
tree4e4a0eadfab63285441468e4e8b12c3c60be215c /crypto/CMakeLists.txt
parentc11e13a78b29289db16a609791cdd61a98cc9d96 (diff)
Add native support for onces and thread-local storage.
Historically, OpenSSL has used callbacks for anything thread related, but we don't actually have that many threading libraries to worry about: just pthreads and Windows (I hope). That suggests that it's quite reasonable to handle threading ourselves, and eliminate the need for users to remember to install the thread callbacks. The first user of this would be ERR, which currently simulates thread-local storage using a lock around a hash table keyed by the TID. (Although I suspect that change will need some CMake work in order that libpthread is automatically included with libcrypto when linking tests etc, but not on Windows and without lots of ifs.) Change-Id: I4dd088e3794506747f875c1f3e92b9bc6700fad2 Reviewed-on: https://boringssl-review.googlesource.com/4010 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/CMakeLists.txt')
-rw-r--r--crypto/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index c454664e..9eb9452a 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -140,6 +140,8 @@ add_library(
crypto.c
mem.c
thread.c
+ thread_pthread.c
+ thread_win.c
ex_data.c
ex_data_impl.c
time_support.c
@@ -195,5 +197,17 @@ add_executable(
target_link_libraries(constant_time_test crypto)
+add_executable(
+ thread_test
+
+ thread_test.c
+)
+
+if(MSVC)
+ target_link_libraries(thread_test crypto)
+else()
+ target_link_libraries(thread_test crypto pthread)
+endif()
+
perlasm(cpu-x86_64-asm.${ASM_EXT} cpu-x86_64-asm.pl)
perlasm(cpu-x86-asm.${ASM_EXT} cpu-x86-asm.pl)