Fix test/SynchronizedTest.cpp build break on Clang on OS X
authorBen Hamilton <beng@fb.com>
Wed, 1 Jun 2016 17:43:50 +0000 (10:43 -0700)
committerFacebook Github Bot 5 <facebook-github-bot-5-bot@fb.com>
Wed, 1 Jun 2016 17:53:27 +0000 (10:53 -0700)
commit70497e418f27ef544cf2cb47e56244e26c6e5e90
treec92c77dd463a82d0dd86e62aedecf3860e7991e1
parent3fe4dacd7dd0224d46e03edfbb87c1c84442b09f
Fix test/SynchronizedTest.cpp build break on Clang on OS X

Summary:
The Folly `make check` build is broken with Clang on OS X.

This diff fixes the following break in `test/SynchronizedTest.cpp`:

  SynchronizedTest.cpp:150:10: error: thread-local storage is not supported for the current target
    static thread_local int lockCount_;

The problem is clang on OS X doesn't support the `thread_local` extension:

http://stackoverflow.com/a/29929949

so we now use the `FOLLY_TLS` compatibility macro.

When I fixed this, I found the test also failed to compile if `FOLLY_SYNCHRONIZED_HAVE_TIMED_MUTEXES` was `#define`d to `0` (as it is on OS X), so I fixed that.

Reviewed By: mzlee

Differential Revision: D3361215

fbshipit-source-id: e93be6872bcab03090448b9421e502e472f149ff
folly/test/SynchronizedTest.cpp