The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
MMU exception Puntino Linux 2 05-07-2008 12:35 PM
how to trap unix signal if the process killed/interupt occured in bash... manas_ranjan Shell Programming and Scripting 15 09-23-2007 08:47 AM
Kernel panic : Fatal exception praveen_b744 UNIX for Advanced & Expert Users 3 09-17-2007 04:50 PM
finding no of counts the words occured arunsubbhian UNIX for Dummies Questions & Answers 5 09-09-2007 04:25 PM
RPC Exception - Help ejbrever UNIX for Advanced & Expert Users 0 08-21-2006 12:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-29-2007
platso platso is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 3
FATAL:exception occured 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.



Can any one tell me the reason why the exception occured.



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 why the exception occured?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0