Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b14de8e6
Commit
b14de8e6
authored
Mar 13, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/utils: use atomic operations on entangled_thread_counter
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b910c6ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
utils.c
libavcodec/utils.c
+3
-3
No files found.
libavcodec/utils.c
View file @
b14de8e6
...
...
@@ -3610,8 +3610,8 @@ int ff_lock_avcodec(AVCodecContext *log_ctx, AVCodec *codec)
if
((
*
lockmgr_cb
)(
&
codec_mutex
,
AV_LOCK_OBTAIN
))
return
-
1
;
}
entangled_thread_counter
++
;
if
(
entangled_thread_counter
!=
1
&&
if
(
avpriv_atomic_int_add_and_fetch
(
&
entangled_thread_counter
,
1
)
!=
1
&&
!
(
codec
->
caps_internal
&
FF_CODEC_CAP_INIT_THREADSAFE
))
{
av_log
(
log_ctx
,
AV_LOG_ERROR
,
"Insufficient thread locking. At least %d threads are "
...
...
@@ -3632,7 +3632,7 @@ int ff_unlock_avcodec(void)
{
av_assert0
(
ff_avcodec_locked
);
ff_avcodec_locked
=
0
;
entangled_thread_counter
--
;
avpriv_atomic_int_add_and_fetch
(
&
entangled_thread_counter
,
-
1
)
;
if
(
lockmgr_cb
)
{
if
((
*
lockmgr_cb
)(
&
codec_mutex
,
AV_LOCK_RELEASE
))
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment