25 static void SDTFA_NeedMixSharedMemory(
void);
26 static SDTFA_MixShared *SDTFA_TryMixSharedMemory(
void);
28 static SDTFA_MixShared *SDTFA_MixShm = NULL;
34 void SDTFA_IncrementShmPacketCount(
void)
38 SDTFA_NeedMixSharedMemory();
40 assert(
sizeof(MixShm->PacketCount)==4);
41 MixShm->PacketCount++;
48 static void SDTFA_NeedMixSharedMemory(
void)
51 if (!SDTFA_TryMixSharedMemory())
54 MixShm=(SDTFA_MixShared*)malloc(
sizeof(SDTFA_MixShared));
55 MixShm->PacketCount=0;
63 static SDTFA_MixShared *SDTFA_TryMixSharedMemory(
void)
66 CAMsg::printMsg(LOG_DEBUG,
"Create/attach shared memory of mix process.\n");
67 assert(
sizeof(key_t)==4);
68 if ((mid=shmget(SDTFA_MIX_SHARED_KEY,
sizeof(SDTFA_MixShared),SHM_MODE))<0)
74 if ((mid=shmget(SDTFA_MIX_SHARED_KEY,
sizeof(SDTFA_MixShared),IPC_CREAT|SHM_MODE))<0)
82 CAMsg::printMsg(LOG_ERR,
"Cant attach to shared memory of mix process.\n");
87 if ((base=shmat(mid,NULL,0))==(
void*)(-1))
93 MixShm=(SDTFA_MixShared*)base;
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.