projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41879b2
)
wpe: Make threaded view singleton creation thread safe
author
Thibault Saunier
<tsaunier@igalia.com>
Thu, 15 Apr 2021 17:28:42 +0000
(13:28 -0400)
committer
Thibault Saunier
<tsaunier@igalia.com>
Thu, 15 Apr 2021 17:29:43 +0000
(13:29 -0400)
It was leading to interesting failures.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2165>
ext/wpe/WPEThreadedView.cpp
patch
|
blob
|
history
diff --git
a/ext/wpe/WPEThreadedView.cpp
b/ext/wpe/WPEThreadedView.cpp
index
ec30741
..
b2c81da
100644
(file)
--- a/
ext/wpe/WPEThreadedView.cpp
+++ b/
ext/wpe/WPEThreadedView.cpp
@@
-66,9
+66,14
@@
static WPEContextThread *s_view = NULL;
WPEContextThread& WPEContextThread::singleton()
{
- if (!s_view)
+ static gsize initialized = 0;
+
+ if (g_once_init_enter (&initialized)) {
s_view = new WPEContextThread;
+ g_once_init_leave (&initialized, 1);
+ }
+
return *s_view;
}