Notify on sink source change.

This commit is contained in:
Peter Johnson
2016-11-18 08:56:24 -08:00
parent b245725941
commit 8e9911d330
3 changed files with 16 additions and 0 deletions

View File

@@ -204,3 +204,15 @@ void Notifier::NotifySink(const SinkImpl& sink, CS_EventKind kind) {
auto handleData = Sinks::GetInstance().Find(sink);
NotifySink(sink.GetName(), handleData.first, kind);
}
void Notifier::NotifySinkSourceChanged(llvm::StringRef name, CS_Sink sink,
CS_Source source) {
auto thr = m_owner.GetThread();
if (!thr) return;
RawEvent event{name, sink, RawEvent::kSinkSourceChanged};
event.sourceHandle = source;
thr->m_notifications.emplace(std::move(event));
thr->m_cond.notify_one();
}