sdm: Cancel display event thread on exit.
- Send a cancellation request to display event thread before waiting
for it join. This thread waits for poll to return indefinitely
which may not return if all of the events (vsync etc) are in
disabled state.
- Drop this call for Android for now as this api is not supported in
bionic.
- Fix GetVSyncState return value.
- Fix pwrite return value in case of set on idle time out.
Change-Id: I7da5be4c8a77fa986450dedb914fa2dba2751da9
diff --git a/sdm/include/utils/sys.h b/sdm/include/utils/sys.h
index 1c7e415..0a90fc1 100644
--- a/sdm/include/utils/sys.h
+++ b/sdm/include/utils/sys.h
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
+#include <pthread.h>
namespace sdm {
@@ -43,6 +44,7 @@
typedef FILE* (*fopen)( const char *fname, const char *mode);
typedef int (*fclose)(FILE* fileptr);
typedef ssize_t (*getline)(char **lineptr, size_t *linelen, FILE *stream);
+ typedef int (*pthread_cancel)(pthread_t thread);
static ioctl ioctl_;
static open open_;
@@ -53,6 +55,7 @@
static fopen fopen_;
static fclose fclose_;
static getline getline_;
+ static pthread_cancel pthread_cancel_;
};
} // namespace sdm