Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: webrtc/base/task_queue_libevent.cc

Issue 2141193002: Call event_assign() instead of event_set(), when available. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Don't set ev_base when using event_set Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/task_queue_libevent.cc
diff --git a/webrtc/base/task_queue_libevent.cc b/webrtc/base/task_queue_libevent.cc
index a59b450828c7b070717579f1a26b5bbda835cfd4..94848f3c349fa6748347dc5a461bcbee44c2f62b 100644
--- a/webrtc/base/task_queue_libevent.cc
+++ b/webrtc/base/task_queue_libevent.cc
@@ -124,8 +124,19 @@ TaskQueue::TaskQueue(const char* queue_name)
SetNonBlocking(fds[1]);
wakeup_pipe_out_ = fds[0];
wakeup_pipe_in_ = fds[1];
+ // TODO(tommi): This is a hack to support two versions of libevent that we're
+ // compatible with. The method we really want to call is event_assign(),
+ // since event_set() has been marked as deprecated (and doesn't accept
+ // passing event_base__ as a parameter). However, the version of libevent
+ // that we have in Chromium, doesn't have event_assign(), so we need to call
+ // event_set() there.
+#if defined(_EVENT2_EVENT_H_)
+ event_assign(wakeup_event_.get(), event_base_, wakeup_pipe_out_,
+ EV_READ | EV_PERSIST, OnWakeup, this);
+#else
event_set(wakeup_event_.get(), wakeup_pipe_out_, EV_READ | EV_PERSIST,
OnWakeup, this);
+#endif
event_base_set(event_base_, wakeup_event_.get());
event_add(wakeup_event_.get(), 0);
thread_.Start();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698