00001 #ifndef _ofxMultiThread_h_00002 #define _ofxMultiThread_h_00003
00004 /*00005 Software License :00006
00007 Copyright (c) 2003-2004, The Foundry Visionmongers Ltd. All rights reserved.00008
00009 Redistribution and use in source and binary forms, with or without00010 modification, are permitted provided that the following conditions are met:00011
00012 * Redistributions of source code must retain the above copyright notice,00013 this list of conditions and the following disclaimer.00014 * Redistributions in binary form must reproduce the above copyright notice,00015 this list of conditions and the following disclaimer in the documentation00016 and/or other materials provided with the distribution.00017 * Neither the name The Foundry Visionmongers Ltd, nor the names of its 00018 contributors may be used to endorse or promote products derived from this00019 software without specific prior written permission.00020
00021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND00022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED00023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE00024 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR00025 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES00026 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;00027 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON00028 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT00029 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS00030 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.00031 */00032
00033
00034 #include "ofxCore.h"00035
00036 #ifdef __cplusplus00037 extern"C" {
00038 #endif00039
00045#define kOfxMultiThreadSuite "OfxMultiThreadSuite"00046
00049typedefstruct OfxMutex *OfxMutexHandle;
00050
00059typedef void (OfxThreadFunctionV1)(unsignedint threadIndex,
00060 unsignedint threadMax,
00061 void *customArg);
00062
00065typedefstruct OfxMultiThreadSuiteV1 {
00090 OfxStatus (*multiThread)(OfxThreadFunctionV1 func,
00091 unsignedint nThreads,
00092 void *customArg);
00093
00104 OfxStatus (*multiThreadNumCPUs)(unsignedint *nCPUs);
00105
00118 OfxStatus (*multiThreadIndex)(unsignedint *threadIndex);
00119
00126 int (*multiThreadIsSpawnedThread)(void);
00127
00138 OfxStatus (*mutexCreate)(const OfxMutexHandle *mutex, int lockCount);
00139
00148 OfxStatus (*mutexDestroy)(const OfxMutexHandle mutex);
00149
00160 OfxStatus (*mutexLock)(const OfxMutexHandle mutex);
00161
00170 OfxStatus (*mutexUnLock)(const OfxMutexHandle mutex);
00171
00183 OfxStatus (*mutexTryLock)(const OfxMutexHandle mutex);
00184
00185 } OfxMultiThreadSuiteV1;
00186
00187 #ifdef __cplusplus00188 }
00189 #endif00190
00191
00192 #endif
Copyright 2003-2004 The Foundry Visonmongers Ltd. All rights reserved.
Copying and redistribution with or without
modification, is permitted provided that the following conditions are met:
Redistributions of the document must retain the above copyright notice
and this list of conditions.
Neither the name of The Foundry Visonmongers Ltd nor names of its
contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.