Move duplicated thread_enable_cancel to CommonLibs
Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708
diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp
index 2988e12..c056d69 100644
--- a/CommonLibs/Threads.cpp
+++ b/CommonLibs/Threads.cpp
@@ -122,6 +122,12 @@
}
}
+void thread_enable_cancel(bool cancel)
+{
+ cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) :
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+}
+
void Thread::start(void *(*task)(void*), void *arg)
{
assert(mThread==((pthread_t)0));