/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/usr/testcore/lib/tls.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ /* implied. See the License for the specific language governing */ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ #ifndef __LIB_TLS_H #define __LIB_TLS_H #include #include #include "../tlsmod/nontrivialctor.H" namespace __tls_test { const size_t THREADS_PER_TEST = 15; constexpr size_t FOOBAR_INIT_VALUE = 0x4321dcba; constexpr size_t FOOBAR_POST_VALUE = 0x4321dcbb; thread_local size_t foobar = FOOBAR_INIT_VALUE; extern thread_local NonTrivialCtor foobar_object; /** * @brief Spawns a set of tasks and waits on them * * @param[in] i_pFnName Name of the function doing the spawning, for * tracing * @param[in] i_pFn Function pointer suitable for passing to a task_create * call */ void spawnTasks( const char* const i_pFnName, void*(*i_pFn)(void*)) { std::vector tids; for(size_t thread=0;thread