drm_hwcomposer: Stop UEvent thread in ResourceManager destructor

When the ResourceManager is destructed, the UEvent thread continues to
run in the background.

Change the blocking read call to poll, and create an eventfd on which to
poll as well. When ResourceManager is destructed, write to the eventfd
to wake the UEvent thread, which can then exit cleanly.

Reported-by: Normunds Rieksts <normunds.rieksts@arm.com>
Change-Id: I18d92173165f31fcd01570e65a6ffd840c8cd138
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/drm/ResourceManager.cpp b/drm/ResourceManager.cpp
index fc00bee..5ac80c4 100644
--- a/drm/ResourceManager.cpp
+++ b/drm/ResourceManager.cpp
@@ -39,6 +39,10 @@
   uevent_listener_ = UEventListener::CreateInstance();
 }
 
+ResourceManager::~ResourceManager() {
+  uevent_listener_->StopThread();
+}
+
 void ResourceManager::Init() {
   if (initialized_) {
     ALOGE("Already initialized");