Loading...
Searching...
No Matches
simpleipc.h
Go to the documentation of this file.
#include <semaphore.h>
#ifndef _SIMPLEIPC_H
#define _SIMPLEIPC_H
#ifdef __cplusplus
extern "C"
{
#endif
#define SIPC_MAX_SEMAPHORES 512
#define USE_SEM_INIT 0
#ifdef __APPLE__
#define PORTABLE_SEMAPHORES 1
#endif
#if PORTABLE_SEMAPHORES
#include <sys/mman.h>
typedef struct {
sem_t *guard, *sig;
int count;
} sipc_sem_t;
#else
typedef sem_t sipc_sem_t;
#endif
EXTERN_VAR sipc_sem_t *semaphore[SIPC_MAX_SEMAPHORES];
EXTERN_VAR int sem_acquired[SIPC_MAX_SEMAPHORES];
int sipc_semaphore_init(int id, int count);
int sipc_semaphore_exists(int id);
int sipc_semaphore_acquire(int id);
int sipc_semaphore_try_acquire(int id);
int sipc_semaphore_get_value(int id);
int sipc_semaphore_release(int id);
int simpleipc_cmd(char *cmd, int id, int v);
#ifdef __cplusplus
}
#endif
#endif
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
semaphore
VAR sipc_sem_t * semaphore[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:24
sem_acquired
VAR int sem_acquired[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:25
count
int status int void size_t count
Definition si_signals.h:69
SIPC_MAX_SEMAPHORES
#define SIPC_MAX_SEMAPHORES
Definition simpleipc.h:10
sipc_semaphore_get_value
int sipc_semaphore_get_value(int id)
Definition semaphore.c:153
sipc_sem_t
sem_t sipc_sem_t
Definition simpleipc.h:27
sipc_semaphore_acquire
int sipc_semaphore_acquire(int id)
Definition semaphore.c:94
sipc_semaphore_release
int sipc_semaphore_release(int id)
Definition semaphore.c:135
simpleipc_cmd
int simpleipc_cmd(char *cmd, int id, int v)
Definition semaphore.c:167
sipc_semaphore_exists
int sipc_semaphore_exists(int id)
Definition semaphore.c:88
sipc_semaphore_try_acquire
int sipc_semaphore_try_acquire(int id)
Definition semaphore.c:112
sipc_semaphore_init
int sipc_semaphore_init(int id, int count)
Definition semaphore.c:31