Changeset 41

Show
Ignore:
Timestamp:
12/05/04 14:34:45 (19 years ago)
Author:
wagi
Message:

MemberFunctor?1::(): Semaphore release added.
asyncCall with 1 parameter added.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freebob/src/threads.h

    r37 r41  
    112112        {  
    113113            ( ( *m_pCallee ).*m_pMemFun )( m_parm0 );  
    114             if (bDelete) { 
     114            if ( m_pSem ) { 
     115                sem_post( m_pSem); 
     116            } 
     117            if (m_bDelete) { 
    115118                delete this; 
    116119            } 
     
    148151//////////////////////////////////////////////////////////////////////// 
    149152 
     153// 0 params 
    150154template< typename CalleePtr, typename Callee,  typename Ret > 
    151155inline void asyncCall( const CalleePtr& pCallee, 
     
    155159} 
    156160 
     161// 1 params 
     162template< typename CalleePtr, typename Callee, typename Ret, typename Parm0 > 
     163inline void asyncCall( const CalleePtr& pCallee, 
     164                       Ret( Callee::*pFunction )( Parm0 ), 
     165                       Parm0 parm0 ) 
     166{ 
     167    WorkerThread::instance()->addFunctor(new MemberFunctor1< CalleePtr, Ret ( Callee::* )( Parm0 ), Parm0 > ( pCallee,  pFunction, parm0 )); 
     168} 
     169 
    157170//////////////////////////////////////////////////////////////////////// 
    158171 
     172// 0 params 
    159173template< typename CalleePtr, typename Callee,  typename Ret > 
    160174inline void syncCall( const CalleePtr& pCallee,