LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Closed Thread
 
Search this Thread
Old 11-29-2007, 07:43 AM   #1
platso
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Rep: Reputation: 0
FATAL: Exception occurred with pthread_exit()


We had written an application in which we create worker thread.

So the main thread will create the worker thread. After some time
the child thread(Worker thread) will call pthread_exit().
This function was written in try{} and there occured an Exception and is handled in catch(...) handler.

This is on Linux platform. Fedora Core 6 and gcc 4.1.

The Implementation of the code is as follows:
This is a simple form of our application, Try to run this small piece
of code.

The output of this is " FATAL: exception not rethrown
Inside catch... Aborted"

#include <stdio.h>
#include <stdlib.h>
#include <stdexcept.h>
#include <pthread.h>

using namespace std;

void print_message_function( void *ptr );
int main()
{
pthread_t thread1;
char *message1 = "Thread 1";
int iret1;

iret1 = pthread_create( &thread1, NULL, (void*(*)(void*))&print_message_function, (void*) message1);

pthread_join( thread1, NULL);


}

void print_message_function( void *ptr )
{
char *message;
message = (char *) ptr;

try
{
pthread_exit((void*) 1);
}
catch(...)
{
printf("Inside catch...\n");
}
}



CAN ANY ONE TELL ME THE REASON FOR THIS EXCEPTION?
 
Old 11-30-2007, 03:02 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
Old 11-30-2007, 05:01 AM   #3
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Fedora 8, Centos 5.1
Posts: 480

Rep: Reputation: 30
Not to mention it should have been posted in Programming.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
add/remove software exception occurred FC6 imakickthebox Linux - Newbie 8 09-23-2007 06:47 PM
exception occurred when opening add/remove software on fedora 5 amee_stars Fedora 2 01-13-2007 06:08 AM
Fatal Exception OpenOffice rabalder321 Linux - Newbie 2 12-19-2005 10:49 AM
unhandled exception has occurred thinhla Fedora - Installation 1 06-02-2005 05:36 PM


All times are GMT -5. The time now is 03:18 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration