NCBI C++ ToolKit
Macros | Functions | Variables
ncbi_lbsm_ipc.c File Reference
#include "ncbi_lbsm_ipc.h"
#include "ncbi_once.h"
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+ Include dependency graph for ncbi_lbsm_ipc.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_USE_ERRCODE_X   Connect_LBSM
 

Functions

static int s_Shmem_Unlock (int which, int sem)
 
static int s_Shmem_Lock (int which, int sem, unsigned int wait)
 
static int s_Shmem_RUnlock (int which)
 
static int s_Shmem_RLock (int which)
 
static int s_Shmem_WUnlock (int which)
 
static int s_Shmem_TryWLock (int which)
 
static int s_Shmem_WLock (int which, int wait)
 
static HEAP s_Shmem_Attach (int which)
 
HEAP LBSM_Shmem_Attach (int fallback)
 
void LBSM_Shmem_Detach (HEAP heap)
 
static void * s_LBSM_ResizeHeap (void *mem, TNCBI_Size newsize, void *unused)
 
HEAP LBSM_Shmem_Create (TNCBI_Size pagesize)
 
static int s_Shmem_Destroy (int which, pid_t own_pid)
 
int LBSM_Shmem_Destroy (HEAP heap)
 
int LBSM_Shmem_Update (HEAP heap, int wait)
 
int LBSM_LBSMD (int check_n_lock)
 
pid_t LBSM_UnLBSMD (int undaemon)
 

Variables

int g_LBSM_NOSYSVIPC = 0
 
static int s_Muxid = -1
 
static int s_Shmid [2] = {-1, -1}
 
static void * s_Shmem [2] = { 0, 0}
 
static TNCBI_Size s_ShmemSize [2] = { 0, 0}
 
static const int k_ShmemKey [2] = { 0x1315549 , 0x12CC3BC }
 
static int s_SemUndo [4] = {0,0,0,0}
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Connect_LBSM

Definition at line 44 of file ncbi_lbsm_ipc.c.

Function Documentation

◆ LBSM_LBSMD()

int LBSM_LBSMD ( int  check_n_lock)

Definition at line 658 of file ncbi_lbsm_ipc.c.

References CORE_Once, g_LBSM_NOSYSVIPC, LBSM_MUTEX_KEY, LBSM_SEM_PROT, and s_Muxid.

Referenced by s_LBSMD().

◆ LBSM_Shmem_Attach()

HEAP LBSM_Shmem_Attach ( int  fallback)

◆ LBSM_Shmem_Create()

HEAP LBSM_Shmem_Create ( TNCBI_Size  pagesize)

◆ LBSM_Shmem_Destroy()

int LBSM_Shmem_Destroy ( HEAP  heap)

Definition at line 574 of file ncbi_lbsm_ipc.c.

References g_LBSM_NOSYSVIPC, heap, HEAP_Destroy(), i, and s_Shmem_Destroy().

Referenced by LBSM_Shmem_Create().

◆ LBSM_Shmem_Detach()

void LBSM_Shmem_Detach ( HEAP  heap)

◆ LBSM_Shmem_Update()

int LBSM_Shmem_Update ( HEAP  heap,
int  wait 
)

◆ LBSM_UnLBSMD()

pid_t LBSM_UnLBSMD ( int  undaemon)

◆ s_LBSM_ResizeHeap()

static void* s_LBSM_ResizeHeap ( void *  mem,
TNCBI_Size  newsize,
void *  unused 
)
static

Definition at line 475 of file ncbi_lbsm_ipc.c.

References CORE_LOGF, eLOG_Trace, free(), and malloc().

Referenced by LBSM_Shmem_Create().

◆ s_Shmem_Attach()

static HEAP s_Shmem_Attach ( int  which)
static

◆ s_Shmem_Destroy()

static int s_Shmem_Destroy ( int  which,
pid_t  own_pid 
)
static

◆ s_Shmem_Lock()

static int s_Shmem_Lock ( int  which,
int  sem,
unsigned int  wait 
)
static

Definition at line 87 of file ncbi_lbsm_ipc.c.

References CORE_LOGF, CORE_LOGF_X, CORE_Msdelay(), eLOG_Trace, eLOG_Warning, s_Muxid, and s_SemUndo.

Referenced by s_Shmem_RLock(), and s_Shmem_TryWLock().

◆ s_Shmem_RLock()

static int s_Shmem_RLock ( int  which)
static

Definition at line 143 of file ncbi_lbsm_ipc.c.

References CORE_LOGF, eLOG_Trace, and s_Shmem_Lock().

Referenced by LBSM_Shmem_Attach(), and LBSM_UnLBSMD().

◆ s_Shmem_RUnlock()

static int s_Shmem_RUnlock ( int  which)
static

Definition at line 132 of file ncbi_lbsm_ipc.c.

References CORE_LOGF, eLOG_Trace, and s_Shmem_Unlock().

Referenced by LBSM_Shmem_Attach(), LBSM_Shmem_Detach(), and LBSM_UnLBSMD().

◆ s_Shmem_TryWLock()

static int s_Shmem_TryWLock ( int  which)
static

◆ s_Shmem_Unlock()

static int s_Shmem_Unlock ( int  which,
int  sem 
)
static

Definition at line 74 of file ncbi_lbsm_ipc.c.

References s_Muxid, and s_SemUndo.

Referenced by s_Shmem_RUnlock(), s_Shmem_WLock(), and s_Shmem_WUnlock().

◆ s_Shmem_WLock()

static int s_Shmem_WLock ( int  which,
int  wait 
)
static

◆ s_Shmem_WUnlock()

static int s_Shmem_WUnlock ( int  which)
static

Definition at line 156 of file ncbi_lbsm_ipc.c.

References CORE_LOGF, eLOG_Trace, s_Muxid, and s_Shmem_Unlock().

Referenced by LBSM_Shmem_Update(), and s_Shmem_WLock().

Variable Documentation

◆ g_LBSM_NOSYSVIPC

int g_LBSM_NOSYSVIPC = 0

◆ k_ShmemKey

const int k_ShmemKey[2] = { 0x1315549 , 0x12CC3BC }
static

Definition at line 53 of file ncbi_lbsm_ipc.c.

Referenced by LBSM_Shmem_Create(), LBSM_Shmem_Update(), LBSM_UnLBSMD(), and s_Shmem_Attach().

◆ s_Muxid

int s_Muxid = -1
static

◆ s_SemUndo

int s_SemUndo[4] = {0,0,0,0}
static

Definition at line 54 of file ncbi_lbsm_ipc.c.

Referenced by s_Shmem_Lock(), s_Shmem_TryWLock(), and s_Shmem_Unlock().

◆ s_Shmem

void* s_Shmem[2] = { 0, 0}
static

◆ s_ShmemSize

TNCBI_Size s_ShmemSize[2] = { 0, 0}
static

◆ s_Shmid

int s_Shmid[2] = {-1, -1}
static
Modified on Sun Jul 14 04:55:41 2024 by modify_doxy.py rev. 669887