Commit e3be7b11 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/get_pool: Remove redundant initial atomic operation

602->442 dezicycles
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9cde9f70
...@@ -239,14 +239,14 @@ void av_buffer_pool_uninit(AVBufferPool **ppool) ...@@ -239,14 +239,14 @@ void av_buffer_pool_uninit(AVBufferPool **ppool)
/* remove the whole buffer list from the pool and return it */ /* remove the whole buffer list from the pool and return it */
static BufferPoolEntry *get_pool(AVBufferPool *pool) 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); FFSWAP(BufferPoolEntry*, cur, last);
cur = avpriv_atomic_ptr_cas((void * volatile *)&pool->pool, last, NULL); cur = avpriv_atomic_ptr_cas((void * volatile *)&pool->pool, last, NULL);
if (!cur) if (!cur)
return NULL; return NULL;
} while (cur != last); }
return cur; return cur;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment