Adding a release function for ThreadLocalPtr.
authorAkshay Vaidya <akshayv@fb.com>
Fri, 9 May 2014 17:07:05 +0000 (10:07 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 20 May 2014 19:53:59 +0000 (12:53 -0700)
commitb51f8cd7431aa84f97cfb6515219b57ed6da2efe
treef47744711debdadc99e4b344bce13196b7925432
parent870912b89844e07283ff6d7e9602952f05ad3840
Adding a release function for ThreadLocalPtr.

Summary:
ThreadLocalPtr manages the lifecycle of the object that is
stored with it. We have a use case where we sometimes want to transfer ownership
of the stored object to another thread by wrapping them with
unique_ptrs. Adding a release function, similar to to the
unique_ptr::release is the cleanest way for us to transfer ownership.

Test Plan:
I can do some on off testing using a command line tool, but I
was wondering about how to add some unit tests. Not sure when the folly
unit tests were.

Reviewed By: njormrod@fb.com

FB internal diff: D1321588
folly/ThreadLocal.h
folly/detail/ThreadLocalDetail.h
folly/test/ThreadLocalTest.cpp