Program Listing for File ThreadLocalChecker.hpp¶
↰ Return to documentation for file (include/uitsl/parallel/ThreadLocalChecker.hpp)
#pragma once
#ifndef UITSL_PARALLEL_THREADLOCALCHECKER_HPP_INCLUDE
#define UITSL_PARALLEL_THREADLOCALCHECKER_HPP_INCLUDE
#include <mutex>
#include "../../../third-party/Empirical/source/base/assert.h"
#include "thread_utils.hpp"
namespace uitsl {
class ThreadLocalChecker {
uitsl::thread_id_t thread_id{ uitsl::get_thread_id() };
public:
ThreadLocalChecker()
{ ; }
void Check() { emp_assert( thread_id == uitsl::get_thread_id() ); }
};
} // namespace uitsl
#endif // #ifndef UITSL_PARALLEL_THREADLOCALCHECKER_HPP_INCLUDE