shithub: openh264

Download patch

ref: 474deacd7a8184ec18a8d34c206f1466f52eea5a
parent: baaa38737e5e4ac27f7de4835dbc0753ff955c74
author: Martin Storsjö <[email protected]>
date: Mon Mar 3 17:55:29 EST 2014

Remove the now unused thread cancellation support

This makes the thread library build on android - android does
not have pthread_cancel.

--- a/codec/common/WelsThreadLib.cpp
+++ b/codec/common/WelsThreadLib.cpp
@@ -152,11 +152,6 @@
   return WELS_THREAD_ERROR_OK;
 }
 
-WELS_THREAD_ERROR_CODE	  WelsSetThreadCancelable() {
-  // nil implementation for WIN32
-  return WELS_THREAD_ERROR_OK;
-}
-
 WELS_THREAD_ERROR_CODE    WelsThreadJoin (WELS_THREAD_HANDLE  thread) {
   WaitForSingleObject (thread, INFINITE);
 
@@ -163,11 +158,7 @@
   return WELS_THREAD_ERROR_OK;
 }
 
-WELS_THREAD_ERROR_CODE    WelsThreadCancel (WELS_THREAD_HANDLE  thread) {
-  return WELS_THREAD_ERROR_OK;
-}
 
-
 WELS_THREAD_ERROR_CODE    WelsThreadDestroy (WELS_THREAD_HANDLE* thread) {
   if (thread != NULL) {
     CloseHandle (*thread);
@@ -217,19 +208,8 @@
   return err;
 }
 
-WELS_THREAD_ERROR_CODE	  WelsSetThreadCancelable() {
-  WELS_THREAD_ERROR_CODE err = pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
-  if (0 == err)
-    err = pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, NULL);
-  return err;
-}
-
 WELS_THREAD_ERROR_CODE    WelsThreadJoin (WELS_THREAD_HANDLE  thread) {
   return pthread_join (thread, NULL);
-}
-
-WELS_THREAD_ERROR_CODE    WelsThreadCancel (WELS_THREAD_HANDLE  thread) {
-  return pthread_cancel (thread);
 }
 
 WELS_THREAD_ERROR_CODE    WelsThreadDestroy (WELS_THREAD_HANDLE* thread) {
--- a/codec/common/WelsThreadLib.h
+++ b/codec/common/WelsThreadLib.h
@@ -118,11 +118,7 @@
 WELS_THREAD_ERROR_CODE    WelsThreadCreate (WELS_THREAD_HANDLE* thread,  LPWELS_THREAD_ROUTINE  routine,
     void* arg, WELS_THREAD_ATTR attr);
 
-WELS_THREAD_ERROR_CODE	  WelsSetThreadCancelable();
-
 WELS_THREAD_ERROR_CODE    WelsThreadJoin (WELS_THREAD_HANDLE  thread);
-
-WELS_THREAD_ERROR_CODE    WelsThreadCancel (WELS_THREAD_HANDLE  thread);
 
 WELS_THREAD_ERROR_CODE    WelsThreadDestroy (WELS_THREAD_HANDLE* thread);