def __init__(self, instance_id=None, status_semid=None, status_key=None): # Init and IPC key information if instance_id is not None: instance_id = 0 else: instance_id = instance_id if status_key is not None: self.status_key = status_key else: self.status_key = hashpipe_key.hashpipe_status_key(instance_id) if status_semid is not None: self.status_semid = status_semid else: self.status_semid = hashpipe_key.hashpipe_status_semname( instance_id) print "BFBE: FlagPole:: status key=%x" % self.status_key print "BFBE: FlagPole:: status semid: %s" % self.status_semid # Create a handle to shared memory self.status_buffer = shm.SharedMemoryHandle(self.status_key) self.sem = _possem.sem_open(self.status_semid, _possem.O_CREAT, 00644, 1) print "BFBE: FlagPole:: FlagPolse.sem", self.sem # Create a header to hold the data read from shared memory self.hdr = None self.read()
def __init__(self, status_key = None, status_semid = None): # Get user dependend IPC key. TBF: multiple instances instance_id = 0 self.status_key = status_key if status_key is not None \ else hashpipe_key.hashpipe_status_key(instance_id) self.status_semid = status_semid if status_semid is not None \ else hashpipe_key.hashpipe_status_semname(instance_id) print "status key: %x " % self.status_key print "status semid: %s" % self.status_semid self.stat_buf = shm.SharedMemoryHandle(self.status_key) self.sem = possem.sem_open(self.status_semid, possem.O_CREAT, 00644, 1) print "vegas_status.sem" , self.sem self.hdr = None self.gbtstat = None self.read()
def __init__(self, status_key=None, status_semid=None): # Get user dependend IPC key. TBF: multiple instances instance_id = 0 self.status_key = status_key if status_key is not None \ else hashpipe_key.hashpipe_status_key(instance_id) self.status_semid = status_semid if status_semid is not None \ else hashpipe_key.hashpipe_status_semname(instance_id) print "status key: %x " % self.status_key print "status semid: %s" % self.status_semid self.stat_buf = shm.SharedMemoryHandle(self.status_key) self.sem = possem.sem_open(self.status_semid, possem.O_CREAT, 00644, 1) print "vegas_status.sem", self.sem self.hdr = None self.gbtstat = None self.read()