mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-29 14:30:27 +00:00
avutil/get_pool: Remove redundant initial atomic operation
602->442 dezicycles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
9cde9f70ab
commit
e3be7b1159
@ -239,14 +239,14 @@ void av_buffer_pool_uninit(AVBufferPool **ppool)
|
||||
/* remove the whole buffer list from the pool and return it */
|
||||
static BufferPoolEntry *get_pool(AVBufferPool *pool)
|
||||
{
|
||||
BufferPoolEntry *cur = NULL, *last = NULL;
|
||||
BufferPoolEntry *cur = *(void * volatile *)&pool->pool, *last = NULL;
|
||||
|
||||
do {
|
||||
while (cur != last) {
|
||||
FFSWAP(BufferPoolEntry*, cur, last);
|
||||
cur = avpriv_atomic_ptr_cas((void * volatile *)&pool->pool, last, NULL);
|
||||
if (!cur)
|
||||
return NULL;
|
||||
} while (cur != last);
|
||||
}
|
||||
|
||||
return cur;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user