unsigned int line, const char *function)
{
errorstream << std::endl << "In thread " << std::hex
- << (unsigned long)thr_get_current_thread_id() << ":" << std::endl;
+ << thr_get_current_thread_id() << ":" << std::endl;
errorstream << file << ":" << line << ": " << function
<< ": An engine assumption '" << assertion << "' failed." << std::endl;
unsigned int line, const char *function)
{
errorstream << std::endl << "In thread " << std::hex
- << (unsigned long)thr_get_current_thread_id() << ":" << std::endl;
+ << thr_get_current_thread_id() << ":" << std::endl;
errorstream << file << ":" << line << ": " << function
<< ": A fatal error occured: " << msg << std::endl;
void DebugStack::print(FILE *file, bool everything)
{
- fprintf(file, "DEBUG STACK FOR THREAD %lx:\n",
- (unsigned long)threadid);
+ std::ostringstream os;
+ os << threadid;
+ fprintf(file, "DEBUG STACK FOR THREAD %s:\n",
+ os.str().c_str());
for(int i=0; i<stack_max_i; i++)
{
void DebugStack::print(std::ostream &os, bool everything)
{
- os<<"DEBUG STACK FOR THREAD "<<(unsigned long)threadid<<": "<<std::endl;
+ os<<"DEBUG STACK FOR THREAD "<<threadid<<": "<<std::endl;
for(int i=0; i<stack_max_i; i++)
{
try {
m_thread_obj = new std::thread(threadProc, this);
- m_thread_id = m_thread->get_id();
- m_thread_handle = m_thread->native_handle();
- } except (const std::system_error &e) {
+ m_thread_id = m_thread_obj->get_id();
+ m_thread_handle = m_thread_obj->native_handle();
+ } catch (const std::system_error &e) {
return false;
}
#ifndef THREADING_THREAD_H
#define THREADING_THREAD_H
+#include "basicmacros.h"
#include "threading/atomic.h"
#include "threading/mutex.h"
#include "threads.h"