IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 13, 2008, 5:23:13 PM (18 years ago)
Author:
Paul Price
Message:

Learned that of all the fftw_ calls, only fftw_execute is thread-safe: all other calls have to be wrapped in a mutex for thread safety.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fft/psFFT.c

    r19004 r19058  
    44
    55#include <fftw3.h>
     6#include <pthread.h>
    67
    78#include "psAssert.h"
    89#include "psLogMsg.h"
    910#include "psFFT.h"
     11
     12static pthread_mutex_t fftwLock = PTHREAD_MUTEX_INITIALIZER; // Lock for FFTW
     13
     14void psFFTLock(void)
     15{
     16    pthread_mutex_lock(&fftwLock);
     17}
     18
     19void psFFTUnlock(void)
     20{
     21    pthread_mutex_unlock(&fftwLock);
     22}
    1023
    1124bool psFFTThreads(int threads)
Note: See TracChangeset for help on using the changeset viewer.