Beispiel #1
0
/**
 * This routine closes an open ET system but differs from @ref et_close in that it
 * automatically closes all attachments.
 *
 * 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.
 * For a remote user, this routine closes the connection between the user and ET system. But before
 * it does any of this, it detaches all attachments belonging to the process calling it. It also
 * frees memory allocated in et_open to create the system's id.
 *
 * @param id          ET system id.
 *
 * @returns @ref ET_OK             if successful
 * @returns @ref ET_ERROR          if bad arg.
 * @returns @ref ET_ERROR_REMOTE   for a local user on a non-mutex-sharing system (MacOS),
 *                                 if cannot unmap shared memory
 */
int et_forcedclose(et_sys_id id) {

    et_id *etid = (et_id *) id;

    if (id == NULL) return ET_ERROR;

    if (etid->locality == ET_REMOTE) {
        return etr_forcedclose(id);
    }
    else if (etid->locality == ET_LOCAL_NOSHARE) {
        return etn_forcedclose(id);
    }
    return etl_forcedclose(id);
}
Beispiel #2
0
int et_forcedclose(et_sys_id id)
{
  return etr_forcedclose(id);
}