123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #if defined(__cplusplus)
- #include <exception>
- #include <new>
- #ifdef __GNUC__
- #include <stdlib.h>
- #endif
- #include "test.h"
- enum {
- NUMTHREADS = 1
- };
- static void *
- exceptionedThread(void * arg)
- {
- int dummy = 0x1;
- throw dummy;
- return (void *) 100;
- }
- int
- pthread_test_exception2()
- {
- int i;
- pthread_t mt;
- pthread_t et[NUMTHREADS];
- std::set_terminate(0);
-
- assert((mt = pthread_self()).p != NULL);
- for (i = 0; i < NUMTHREADS; i++)
- {
- assert(pthread_create(&et[i], NULL, exceptionedThread, NULL) == 0);
- }
- pte_osThreadSleep(1000);
-
- return 0;
- }
- #else
- #include <stdio.h>
- int
- pthread_test_exception2()
- {
- printf("Test N/A for this compiler environment.\n");
- return 0;
- }
- #endif
|