Changeset 2162

Show
Ignore:
Timestamp:
06/04/12 07:06:30 (9 years ago)
Author:
jwoithe
Message:

Possibly address ticket #354. It seems that some FFADO threads can take a while to start: so long in fact that short operations (like 'ffado-test BusReset?') can be completed before all threads have completed their startup sequence. This in turn can create problems during shutdown (or any other operation which assumes that all threads are operational) . The obvious way to deal with this is with the use of a small delay to give the threads a chance to start, so we will try that and see what happens.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libieee1394/ieee1394service.cpp

    r1930 r2162  
    3030#include "CycleTimerHelper.h" 
    3131 
     32#include <unistd.h> 
    3233#include <libraw1394/csr.h> 
    3334#include <libiec61883/iec61883.h> 
     
    402403        return false; 
    403404    } 
     405 
     406    // Give time for all threads to start.  Otherwise it can happen that 
     407    // some FFADO threads are ready to run before others.  If the former 
     408    // then go ahead and use the latter on the assumption that they're 
     409    // running, race conditions can occur.  The delay here has been  
     410    // determined experimentally. 
     411    usleep(500); 
    404412 
    405413    // make sure that the thread parameters of all our helper threads are OK