Don't create TLS vector on Get.
Previously, TLS::Slot::Get() would create the TLS vector if it doesn't yet exist and then return the slot value which of course is null since it was just created. Now, just return null instead of creating the vector. The vector will be created by Set() if it doesn't exist. This allows clients to make use of an existing slot in dangerous situations (such as exception handling) without necessarily creating the underlying vector at that time. Bug: 821494 Change-Id: I404524ec7ccf0da4ea5451eea25b49783a711c04 Reviewed-on: https://chromium-review.googlesource.com/1007682 Commit-Queue: Brian White <bcwhite@chromium.org> Reviewed-by:Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#549979}
Showing
Please register or sign in to comment