LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2004, 10:42 PM   #1
anubhuti_k
LQ Newbie
 
Registered: Oct 2004
Location: India
Distribution: Suse 9.1
Posts: 29

Rep: Reputation: 15
QThread::exit() does not work


I tried killing my global QThread using finish() and terminate() both but none worked. What may be the problem.
I have started a global thread in one function and have also set an alarm signal . In the signal handler of this alarm signal i have tried to terminate the thread. I have checked that on timeout the control enters the signal handler but the thread.exit() statement and thread.finish()

here is the small code:
void sighand(int no)
{
bool p;
int i=0;
while(i<100)
{
if((p = a.finished())==FALSE)
{
cout<<"thread not killed\n"; //neither this is printed
a.exit();
}
else
cout<<"thread killed\n"; //nor this is printed
}
i++;

}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Qthread VS Pthread (threading problem) chanwing Programming 5 07-01-2005 07:05 AM
[SOLVED] Run program on Linux Startuo (Save on exit won't work!) ziphem Linux - Newbie 1 01-13-2005 07:01 AM
QThread Penguinizer Programming 9 02-21-2003 09:21 AM
Do you have documents of QThread programming ? mikexu Programming 1 01-02-2002 10:00 AM
Using QThread class Toanlv Programming 0 11-13-2001 09:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration