Пример #1
0
/**
 * This routine closes an open ET system.
 *
 * Given a local ET system that has been opened with a call to @ref et_open, this routine will stop
 * all ET-related threads and unmap the system's memory from the user's space making it inaccessible.
 * It also frees memory allocated in et_open to create the system's id. For a remote user, all this
 * routine does is close the connection between the user and ET system as well as free the memory
 * allocated in creating the system's id.
 *
 * This routine should only be called once for a particular ET system after the associated call
 * to et_open. In addition, all attachments of the process calling this routine must be detached
 * first or an error will be returned.
 *
 * @param id          ET system id.
 *
 * @returns @ref ET_OK             if successful
 * @returns @ref ET_ERROR          if bad arg, not detached from all stations.
 * @returns @ref ET_ERROR_REMOTE   for a local user on a non-mutex-sharing system (MacOS),
 *                                 if cannot unmap shared memory
 */
int et_close(et_sys_id id) {

    et_id *etid = (et_id *) id;

    if (id == NULL) return ET_ERROR;

    if (etid->locality == ET_REMOTE) {
        return etr_close(id);
    }
    else if (etid->locality == ET_LOCAL_NOSHARE) {
        return etn_close(id);
    }
    return etl_close(id);
}
Пример #2
0
int et_close(et_sys_id id)
{
  return etr_close(id);
}