summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch')
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch48
1 files changed, 0 insertions, 48 deletions
diff --git a/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch b/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch
deleted file mode 100644
index eaf49405..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1From f6f9d62817d58909fe9eafa555b1638f165dc746 Mon Sep 17 00:00:00 2001
2From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
3Date: Wed, 2 Mar 2022 07:56:57 +0800
4Subject: [PATCH] sample_common: Fix regression of missing mutex init
5
6Upstream-Status: Submitted
7innersource PR #377
8
9Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
10---
11 tools/legacy/sample_common/src/vm/thread_linux.cpp | 14 ++++++++++++++
12 1 file changed, 14 insertions(+)
13
14diff --git a/tools/legacy/sample_common/src/vm/thread_linux.cpp b/tools/legacy/sample_common/src/vm/thread_linux.cpp
15index 819d811f..c17ce5bf 100644
16--- a/tools/legacy/sample_common/src/vm/thread_linux.cpp
17+++ b/tools/legacy/sample_common/src/vm/thread_linux.cpp
18@@ -22,6 +22,13 @@ MSDKSemaphore::MSDKSemaphore(mfxStatus& sts, mfxU32 count) : msdkSemaphoreHandle
19 // If pthread_cond_init reports an error m_semaphore was not allocated
20 throw std::bad_alloc();
21 }
22+ res = pthread_mutex_init(&m_mutex, NULL);
23+ if (res) {
24+ if (!pthread_cond_destroy(&m_semaphore)) {
25+ // do nothing
26+ }
27+ throw std::bad_alloc();
28+ }
29 }
30
31 MSDKSemaphore::~MSDKSemaphore(void) {
32@@ -97,6 +104,13 @@ MSDKEvent::MSDKEvent(mfxStatus& sts, bool manual, bool state) : msdkEventHandle(
33 //non-zero means something is wrong, throw bad_alloc
34 throw std::bad_alloc();
35 }
36+ res = pthread_mutex_init(&m_mutex, NULL);
37+ if (res) {
38+ if (!pthread_cond_destroy(&m_event)) {
39+ // do nothing
40+ }
41+ throw std::bad_alloc();
42+ }
43 }
44
45 MSDKEvent::~MSDKEvent(void) {
46--
472.17.1
48