31 #include <shm_arena.h>
39 ptr = (
int *)
sm_get(
sizeof(
int),
"count");
42 printf(
"sm_get() failed\n");
52 printf(
"read %d\n", *ptr);
53 if(*ptr >= 10) running = 0;
static int sm_unlock(const void *ptr)
release a shared memory segment read-write lock
static void * sm_get(size_t size, const char *name)
get a shared memory segment
static int sm_rdlock(const void *ptr)
acquire a shared memory segment read lock