out-line the SharedMutexImpl members that directly reference tls_lastTokenlessSlot
authorEric Niebler <eniebler@fb.com>
Fri, 15 Jul 2016 21:43:18 +0000 (14:43 -0700)
committerFacebook Github Bot 5 <facebook-github-bot-5-bot@fb.com>
Fri, 15 Jul 2016 21:53:24 +0000 (14:53 -0700)
commitd0a6ecc6823908af8ed78e25ed3ca0f9f14e27c5
treeddca3e2846dc1b3cfce515b27e31cdc70a68bc33
parentf3c02cfc375500e7a082c75896d888a0fcd1f3c4
out-line the SharedMutexImpl members that directly reference tls_lastTokenlessSlot

Summary: Recent changes to SharedMutex.h broke mcrouter's open source build. See https://travis-ci.org/facebook/mcrouter/builds/140608809. It looks like we're getting bitten by https://sourceware.org/bugzilla/show_bug.cgi?id=16773. We're hitting it now because the extern template is forcing the instantiation of the thread-local static member to be located in SharedMutex.o, but the inline members that reference that thread-local are *not* located in SharedMutex.o. binutils seems to be stepping on its own feet trying to fix up the references at link time. We can fix it by making sure the code that references the thread-local is colocated with the thread-local.

Reviewed By: yfeldblum

Differential Revision: D3498477

fbshipit-source-id: 86ea86812010ff1ef7351e6f8c106bb4291d0234
folly/SharedMutex.h