www.pudn.com > sharemem.rar > share_mem.h


#ifndef PORTALSERVER_SHARE_MEM_H 
#define PORTALSERVER_SHARE_MEM_H 
 
#include "session.h" 
 
#define SYS_QUIT  -1 
 
 
struct share_memory{ 
	int queue_id; 
	unsigned short int CurrentSN; 
	int    count; 
	int    command; 
	struct AuthSession session_table[65536]; 
}; 
 
struct Msg 
{ 
	long      msg_code; 
	unsigned short int SerialNo; /*传递WEB请求时的会话序列号*/	 
}; 
 
extern struct share_memory *pShm; 
extern pthread_mutex_t mutex; 
extern pthread_mutex_t mutex_log; 
 
int CreateShm(); 
int ConnectShm(struct share_memory *pShareMem); 
int DisconShm(); 
int RemoveShm(); 
int LockShm(); 
int unLockShm(); 
void local_log(char *info); 
 
#endif