Overview
Features
Download
Documentation
Community
Add-Ons & Services

unable to start a thread.

Please post support and help requests here.

unable to start a thread.

Postby dagg » 08 May 2009, 22:09

I've wrote a runnable class that suppose to run a thread in the back gorund, the code is this:
Code: Select all
Poco::Thread thread("msg logger");
  LogThread logTrd();
  thread.start(logTrd);

and LogThread is:
Code: Select all
class LogThread : public Poco::Runnable {
  public:
    LogThread();

    ~LogThread();
    void run();
    void setStopSignal();

  private:
    bool mStop;
};

and
Code: Select all
include "CLogThread.h"

LogThread::LogThread() : Poco::Runnable() {
  mStop=false;
}


LogThread::~LogThread() { }

/*!
    \fn LogThread::run()
 */
void LogThread::run() {
  while (!mStop) {
    sleep(50);
    NetLogger::instance().emptyQueue();
  }
}


/*!
    \fn LogThread::setStopSignal()
 */
void LogThread::setStopSignal() {
  mStop=true;
}


but compilation returns this:
Code: Select all
/home/dagg/workspace/NeuroNet/src/Data/CNeuroNet.cpp:32: error: invalid conversion from 'LogThread (*)()' to 'void (*)(void*)'
/home/dagg/workspace/NeuroNet/src/Data/CNeuroNet.cpp:32: error: initializing argument 1 of 'void Poco::Thread::start(void (*)(void*), void*)'


any hints on how to solve this?
dagg
 
Posts: 18
Joined: 28 Mar 2008, 09:07

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest