Пример #1
0
/*      Get number of events made by attachment       */
int et_attach_geteventsmake(et_sys_id id, et_att_id att_id,
                            uint64_t *events)
{
  et_id *etid = (et_id *) id;
  
  if (etid->locality == ET_REMOTE) {
      return etr_attach_geteventsmake(id, att_id, events);
  }
  
  if (!et_alive(id)) {
      return ET_ERROR_DEAD;
  }
  
  /* Protection from (local) et_close() unmapping shared memory */
  et_memRead_lock(etid);

  /* Has caller already called et_close()? */
  if (etid->closed) {
      et_mem_unlock(etid);
      if (etid->debug >= ET_DEBUG_ERROR) {
          et_logmsg("ERROR", "et_attach_geteventsmake, et id is closed\n");
      }
      return ET_ERROR_CLOSED;
  }
  
  if ((att_id < 0) || (att_id >= etid->sys->config.nattachments)) {
      et_mem_unlock(etid);
      if (etid->debug >= ET_DEBUG_ERROR) {
          et_logmsg("ERROR", "et_attach_geteventsmake, bad attachment id\n");
      }
      return ET_ERROR;
  }
  
  if (events != NULL) {
      *events = etid->sys->attach[att_id].events_make;
  }
  
  et_mem_unlock(etid);
  return ET_OK;
}
Пример #2
0
/*      Get number of events made by attachment       */
int et_attach_geteventsmake(et_sys_id id, et_att_id att_id,
                            uint64_t *events)
{
    return etr_attach_geteventsmake(id, att_id, events);
}