do O(1) instead of O(n) atomic operations in register functions
about 1ms faster startup time Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2b215f3939
commit
133fbfc781
3 changed files with 6 additions and 5 deletions
|
|
@ -490,7 +490,7 @@ int avfilter_register(AVFilter *filter)
|
|||
|
||||
filter->next = NULL;
|
||||
|
||||
while(avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))
|
||||
while(*f || avpriv_atomic_ptr_cas((void * volatile *)f, NULL, filter))
|
||||
f = &(*f)->next;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue