Author: pluto
Date: Thu Jun 19 15:37:51 2008
New Revision: 9816

Modified:
   backtracexx/example.cpp
   backtracexx/makefile
Log:
- single/multi threaded example/test.


Modified: backtracexx/example.cpp
==============================================================================
--- backtracexx/example.cpp     (original)
+++ backtracexx/example.cpp     Thu Jun 19 15:37:51 2008
@@ -21,7 +21,6 @@
                volatile int* p = 0;
                *p = 0;
        }
-       throw std::runtime_error( "still alive?" );
 }
 
 void bar( void ( *f )() )
@@ -29,21 +28,24 @@
        f();
 }
 
-void foo()
+void* foo( void* )
 {
        bar( &zoo );
+       pthread_exit( 0 );
 }
 
-int main()
+int main( int argc, char const* const* argv )
 {
        signal( SIGSEGV, signalHandler );
-       try
+       if ( argc > 1 )
        {
-               foo();
+               pthread_t t;
+               pthread_create( &t, 0, &foo, 0 );
+               pthread_join( t, 0 );
        }
-       catch ( std::exception const& e )
-       {
-               std::cerr << e.what() << std::endl;
+       else
+       {       
+               foo( 0 );
        }
        return 0;
 }

Modified: backtracexx/makefile
==============================================================================
--- backtracexx/makefile        (original)
+++ backtracexx/makefile        Thu Jun 19 15:37:51 2008
@@ -5,7 +5,7 @@
 
 example: example.cpp backtracexx.hpp backtracexx.cpp
        $(CXX) $(CXXFLAGS) -fpic backtracexx.cpp -o libbacktracexx.so -shared 
-s -ldl -static-libgcc
-       $(CXX) $(CXXFLAGS) example.cpp -o example ./libbacktracexx.so -s 
-Wl,--export-dynamic
+       $(CXX) $(CXXFLAGS) -pthread example.cpp -o example ./libbacktracexx.so 
-s -Wl,--export-dynamic
 
 clean:
        rm -f *.o *.s *.ii example libbacktracexx.so
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to