Exemplo n.º 1
0
void
MM_EnvironmentStandard::flushGCCaches()
{
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
	if (getExtensions()->concurrentScavenger) {
		if (MUTATOR_THREAD == getThreadType()) {
			if (NULL != getExtensions()->scavenger) {
				getExtensions()->scavenger->threadFinalReleaseCopyCaches(this, this);
			}
		}
	}
#endif /* OMR_GC_CONCURRENT_SCAVENGER */
}
Exemplo n.º 2
0
void
MM_EnvironmentStandard::flushNonAllocationCaches()
{
	MM_EnvironmentBase::flushNonAllocationCaches();

#if defined(OMR_GC_MODRON_SCAVENGER)
	if (getExtensions()->scavengerEnabled) {
		if (MUTATOR_THREAD == getThreadType()) {
			flushRememberedSet();
		}
	}
#endif /* OMR_GC_MODRON_SCAVENGER */
}
Exemplo n.º 3
0
// Record info about the current thread for the debugger client to use
// when listing all threads which are interrupted.
DThreadInfoPtr DebuggerProxy::createThreadInfo(const std::string &desc) {
  TRACE(2, "DebuggerProxy::createThreadInfo\n");
  DThreadInfoPtr info(new DThreadInfo());
  info->m_id = (int64_t)Process::GetThreadId();
  info->m_desc = desc;
  Transport *transport = g_context->getTransport();
  if (transport) {
    info->m_type = transport->getThreadTypeName();
    info->m_url = transport->getCommand();
  } else {
    info->m_type = getThreadType();
  }
  return info;
}
Exemplo n.º 4
0
int GUIAction::doActions()
{
    if (mActions.size() < 1) {
        return -1;
    }

    // Determine in which thread to run the actions.
    // Do it for all actions at once before starting, so that we can cancel the whole batch if the thread is already busy.
    ThreadType threadType = THREAD_NONE;
    for (auto it = mActions.begin(); it != mActions.end(); ++it) {
        ThreadType tt = getThreadType(*it);
        if (tt == THREAD_NONE) {
            continue;
        }
        if (threadType == THREAD_NONE) {
            threadType = tt;
        } else if (threadType != tt) {
            LOGE("Can't mix normal and cancel actions in the same list. "
                 "Running the whole batch in the cancel thread.");
            threadType = THREAD_CANCEL;
            break;
        }
    }

    // Now run the actions in the desired thread.
    switch (threadType) {
    case THREAD_ACTION:
        action_thread.threadActions(this);
        break;

    case THREAD_CANCEL:
        cancel_thread.threadActions(this);
        break;

    default: {
        // no iterators here because theme reloading might kill our object
        const size_t cnt = mActions.size();
        for (size_t i = 0; i < cnt; ++i) {
            doAction(mActions[i]);
        }
    }
    }

    return 0;
}