talpa/main.cpp
// runs on a separate thread:
runs on a separate thread.
runs on a separate thread .
void* advance_frame_async( void* )
    {      
        pthread_mutex_lock( &surf_mutex );
        advance_frame();   
        int ok = pthread_mutex_unlock( &surf_mutex );   
        assert( ok == 0 );
        pthread_mutex_lock( &thread_is_running_mutex );
        thread_is_running = false;
        ok = pthread_mutex_unlock( &thread_is_running_mutex );
        assert( ok == 0 );
        return NULL;
    }
void * advance_frame_async ( void * ) { pthread_mutex_lock ( & surf_mutex ) ; advance_frame ( ) ; int ok = pthread_mutex_unlock ( & surf_mutex ) ; assert ( ok == 0 ) ; pthread_mutex_lock ( & thread_is_running_mutex ) ; thread_is_running = false ; ok = pthread_mutex_unlock ( & thread_is_running_mutex ) ; assert ( ok == 0 ) ; return NULL ; }
runs on a separate thread:
runs on a separate thread :
// advance one frame // and signal we're done