Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3802

Show
Ignore:
Timestamp:
07/25/08 15:49:20 (4 months ago)
Author:
sean
Message:

Modified Thread.join() and Fiber.call() to return the unhandled exception if rethrow = false rather than just throwing it away. This closes #1170

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/common/tango/core/Thread.d

    r3801 r3802  
    534534     *  ThreadException if the operation fails. 
    535535     *  Any exception not handled by the joined thread. 
    536      */ 
    537     final void join( bool rethrow = true ) 
     536     * 
     537     * Returns: 
     538     *  Any exception not handled by this thread if rethrow = false, null 
     539     *  otherwise. 
     540     */ 
     541    final Object join( bool rethrow = true ) 
    538542    { 
    539543        version( Win32 ) 
     
    558562            volatile m_addr = m_addr.init; 
    559563        } 
    560         if( rethrow && m_unhandled ) 
    561         { 
    562             throw m_unhandled; 
    563         } 
     564        if( m_unhandled ) 
     565        { 
     566            if( rethrow ) 
     567                throw m_unhandled; 
     568            return m_unhandled; 
     569        } 
     570        return null; 
    564571    } 
    565572 
     
    26132620     * Throws: 
    26142621     *  Any exception not handled by the joined thread. 
    2615      */ 
    2616     final void call( bool rethrow = true ) 
     2622     * 
     2623     * Returns: 
     2624     *  Any exception not handled by this fiber if rethrow = false, null 
     2625     *  otherwise. 
     2626     */ 
     2627    final Object call( bool rethrow = true ) 
    26172628    in 
    26182629    { 
     
    26492660            m_unhandled = null; 
    26502661            if( rethrow ) 
    2651             { 
    26522662                throw obj; 
    2653             } 
    2654         } 
     2663            return obj; 
     2664        } 
     2665        return null; 
    26552666    } 
    26562667