diff --git a/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h b/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h index 887718b80..50ef3d82d 100644 --- a/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h +++ b/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h @@ -14,6 +14,8 @@ enum { }; typedef void* MPCriticalRegionID; +typedef struct OpaqueMPSemaphoreID *MPSemaphoreID; +typedef ItemCount MPSemaphoreCount; Boolean _MPIsFullyInitialized(); OSStatus MPDelayUntil(AbsoluteTime* time); @@ -23,7 +25,10 @@ OSStatus MPCreateCriticalRegion(MPCriticalRegionID* criticalRegion); OSStatus MPDeleteCriticalRegion(MPCriticalRegionID criticalRegion); OSStatus MPEnterCriticalRegion(MPCriticalRegionID criticalRegion, Duration timeout); OSStatus MPExitCriticalRegion(MPCriticalRegionID criticalRegion); - +OSStatus MPCreateSemaphore(MPSemaphoreCount maximumValue, MPSemaphoreCount initialValue, MPSemaphoreID *semaphore); +OSStatus MPDeleteSemaphore(MPSemaphoreID semaphore); +OSStatus MPSignalSemaphore(MPSemaphoreID semaphore); +OSStatus MPWaitOnSemaphore(MPSemaphoreID semaphore, Duration timeout); // other functions are missing... #ifdef __cplusplus diff --git a/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp b/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp index a161ba3db..052775509 100644 --- a/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp +++ b/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp @@ -21,8 +21,15 @@ along with Darling. If not, see . #include #include #include +#include +#include #include +static int verbose = 0; +__attribute__((constructor)) static void initme(void) { + verbose = getenv("STUB_VERBOSE") != NULL; +} + Boolean _MPIsFullyInitialized() { return true; @@ -109,3 +116,27 @@ OSStatus MPExitCriticalRegion(MPCriticalRegionID criticalRegion) else return paramErr; } + +OSStatus MPCreateSemaphore(MPSemaphoreCount maximumValue, MPSemaphoreCount initialValue, MPSemaphoreID *semaphore) +{ + if (verbose) puts("STUB: MPCreateSemaphore called"); + return noErr; +} + +OSStatus MPDeleteSemaphore(MPSemaphoreID semaphore) +{ + if (verbose) puts("STUB: MPDeleteSemaphore called"); + return noErr; +} + +OSStatus MPSignalSemaphore(MPSemaphoreID semaphore) +{ + if (verbose) puts("STUB: MPSignalSemaphore called"); + return noErr; +} + +OSStatus MPWaitOnSemaphore(MPSemaphoreID semaphore, Duration timeout) +{ + if (verbose) puts("STUB: MPWaitOnSemaphore called"); + return noErr; +} \ No newline at end of file