![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|