//********************************** Banshee Engine (www.banshee3d.com) **************************************************// //**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************// #pragma once #define BS_AUTO_MUTEX_NAME mutex #include #include #include #include #include "Threading/BsSpinLock.h" /** @addtogroup Threading * @{ */ /** Returns the number of logical CPU cores. */ #define BS_THREAD_HARDWARE_CONCURRENCY std::thread::hardware_concurrency() /** Returns the ThreadId of the current thread. */ #define BS_THREAD_CURRENT_ID std::this_thread::get_id() /** Causes the current thread to sleep for the provided amount of milliseconds. */ #define BS_THREAD_SLEEP(ms) std::this_thread::sleep_for(std::chrono::milliseconds(ms)); /** Wrapper for the C++ std::mutex. */ using Mutex = std::mutex; /** Wrapper for the C++ std::recursive_mutex. */ using RecursiveMutex = std::recursive_mutex; /** Wrapper for the C++ std::condition_variable. */ using Signal = std::condition_variable; /** Wrapper for the C++ std::thread. */ using Thread = std::thread; /** Wrapper for the C++ std::thread::id. */ using ThreadId = std::thread::id; /** Wrapper for the C++ std::unique_lock. */ using Lock = std::unique_lock; /** Wrapper for the C++ std::unique_lock. */ using RecursiveLock = std::unique_lock; /** @} */