|
|
|
@ -25,10 +25,11 @@
|
|
|
|
|
#include <semaphore.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include "hal_thread.h"
|
|
|
|
|
|
|
|
|
|
#include "libiec61850_platform_includes.h"
|
|
|
|
|
#include "lib_memory.h"
|
|
|
|
|
|
|
|
|
|
struct sThread {
|
|
|
|
|
struct sThread
|
|
|
|
|
{
|
|
|
|
|
ThreadExecutionFunction function;
|
|
|
|
|
void* parameter;
|
|
|
|
|
pthread_t pthread;
|
|
|
|
@ -39,9 +40,9 @@ struct sThread {
|
|
|
|
|
Semaphore
|
|
|
|
|
Semaphore_create(int initialValue)
|
|
|
|
|
{
|
|
|
|
|
char tmpname[] = {"/tmp/libiec61850.XXXXXX"};
|
|
|
|
|
mktemp(tmpname);
|
|
|
|
|
Semaphore self = sem_open(tmpname, O_CREAT, 0666, initialValue);
|
|
|
|
|
Semaphore self = GLOBAL_MALLOC(sizeof(sem_t));
|
|
|
|
|
|
|
|
|
|
sem_init((sem_t*) self, 0, initialValue);
|
|
|
|
|
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|