Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
once.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6/**************************************************************************************************/
7
8#ifndef ADOBE_ONCE_HPP
9#define ADOBE_ONCE_HPP
10
11/**************************************************************************************************/
12
13#define ADOBE_THREAD_LOCAL_STORAGE_1(type, signature, ctor_p1) \
14 type& adobe_thread_local_storage_##signature##_access() { \
15 thread_local type holder{ctor_p1}; \
16 return holder; \
17 }
18
19#define ADOBE_THREAD_LOCAL_STORAGE(type, signature) \
20 type& adobe_thread_local_storage_##signature##_access() { \
21 thread_local type holder; \
22 return holder; \
23 }
24
25#define ADOBE_THREAD_LOCAL_STORAGE_INITIALIZE(signature)
26
27#define ADOBE_THREAD_LOCAL_STORAGE_ACCESS(signature) \
28 adobe_thread_local_storage_##signature##_access()
29
30/**************************************************************************************************/
31
32#endif // ADOBE_ONCE_HPP
33
34/**************************************************************************************************/