-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from tesonep/feature/merge-new-threadedFFI-ver…
…sion merge-new-threadedFFI-version
- Loading branch information
Showing
17 changed files
with
261 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef __PSEMAPHORE__ | ||
#define __PSEMAPHORE__ | ||
|
||
typedef struct __Semaphore { | ||
void *handle; | ||
int (*wait)(struct __Semaphore *semaphore); | ||
int (*signal)(struct __Semaphore *semaphore); | ||
void (*free)(struct __Semaphore *semaphore); | ||
} Semaphore; | ||
|
||
#endif // ifndef __PSEMAPHORE__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef __PLATFORM_SEMAPHORE__ | ||
#define __PLATFORM_SEMAPHORE__ | ||
|
||
#include "pSemaphore.h" | ||
#include "pharovm/pharo.h" | ||
|
||
#include <stdlib.h> | ||
|
||
#ifndef __APPLE__ | ||
// I am a normal unix | ||
#include <pthread.h> | ||
#include <semaphore.h> | ||
#include <errno.h> | ||
|
||
typedef sem_t* PlatformSemaphore; | ||
#define isValidSemaphore(aSemaphore) (aSemaphore != NULL) | ||
#else | ||
// I am OSX | ||
#include <dispatch/dispatch.h> | ||
|
||
typedef dispatch_semaphore_t PlatformSemaphore; | ||
#define isValidSemaphore(aSemaphore) (1) | ||
#endif // ifndef __APPLE__ | ||
|
||
EXPORT(Semaphore) *platform_semaphore_new(int initialValue); | ||
|
||
#endif // ifndef __PLATFORM_SEMAPHORE__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.