summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis2019-06-11 16:12:10 -0500
committerAndrew F. Davis2019-06-28 10:32:54 -0500
commit27d8ef020a4fa9482069d2d84c6028c9aaa7c760 (patch)
treead022b728c69ae37272243d3976f90de47155189
parent595c7819bb42e1ddda7362a98000dfbe61b627e8 (diff)
downloadhardware-ti-am65x-27d8ef020a4fa9482069d2d84c6028c9aaa7c760.tar.gz
hardware-ti-am65x-27d8ef020a4fa9482069d2d84c6028c9aaa7c760.tar.xz
hardware-ti-am65x-27d8ef020a4fa9482069d2d84c6028c9aaa7c760.zip
libhwcomposer: Catch thread creation warnings and print the exception
Thread creation can fail which is not always fatal, catch the exception and print out the exceptions information for both the DRM and the HDMI event listening thread. Signed-off-by: Andrew F. Davis <afd@ti.com>
-rw-r--r--libhwcomposer/hwc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index d4bdbb8..eac7ffc 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -627,8 +627,8 @@ static void hwc_registerProcs(struct hwc_composer_device_1* dev, hwc_procs_t con
627 /* now that cb_procs->hotplug is valid */ 627 /* now that cb_procs->hotplug is valid */
628 try { 628 try {
629 hwc_dev->hdmi_thread = new std::thread(hwc_hdmi_thread, hwc_dev); 629 hwc_dev->hdmi_thread = new std::thread(hwc_hdmi_thread, hwc_dev);
630 } catch (...) { 630 } catch (std::exception& ex) {
631 ALOGE("Failed to create HDMI listening thread (%s)", strerror(errno)); 631 ALOGW("Failed to create HDMI listening thread (%s)", ex.what());
632 } 632 }
633} 633}
634 634
@@ -695,7 +695,11 @@ static int hwc_device_open(const hw_module_t* module, const char* name, hw_devic
695 return -1; 695 return -1;
696 } 696 }
697 697
698 hwc_dev->event_thread = new std::thread(hwc_drm_event_thread, hwc_dev); 698 try {
699 hwc_dev->event_thread = new std::thread(hwc_drm_event_thread, hwc_dev);
700 } catch (std::exception& ex) {
701 ALOGE("Failed to create DRM event listening thread (%s)", ex.what());
702 }
699 703
700 hwc_dev->device.common.tag = HARDWARE_DEVICE_TAG; 704 hwc_dev->device.common.tag = HARDWARE_DEVICE_TAG;
701 hwc_dev->device.common.version = HWC_DEVICE_API_VERSION_1_1; 705 hwc_dev->device.common.version = HWC_DEVICE_API_VERSION_1_1;