Mayank Jain wrote:
Hi,
I have problems with implementing threads in Wengophone code.
I am running a voice recognition engine which runs indefinitely in a loop listening to the audio as input by the user. I need to implement this engine in a separate thread. So, how should I go about it ??

Check the Thread class inside the directory
wengophone-ng\trunk\libs\util\thread\include\thread

It's very easy to use, it's exactly like in Java.
Our Thread class is based on boost::thread with an easier syntax.

class MyThread : public Thread {
private:
        void run() {
                std::cout << "Hello World!" << std::endl;
        }
};

MyThread * myThread = new MyThread();
myThread->start();


You can control (if you need it) the event loop and insert events inside the event loop using Thread::postEvent(ThreadEvent * event) and Thread::runEvents()

--
Tanguy Krotoff <[EMAIL PROTECTED]>
http://openwengo.org
_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to