Opened 12 years ago
Closed 12 years ago
#1861 closed defect (invalid)
av_lockmgr_register doesn't destroy the mutex
Reported by: | John | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avutil |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Hello,
av_lockmgr_register doesn't invoke callBack function with AV_LOCK_DESTROY after using a mutex;
log:
Create a mutex
Create a mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Change History (4)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I expect that function must itself destroy the mutex after all manipulations, because it creates them
comment:3 by , 12 years ago
And how would it know that you're done using it?
For all it knows, you may continue calling the APIs at any moment.
When your application closes, just call the register function with a NULL argument, and it will destroy the mutex.
comment:4 by , 12 years ago
Keywords: | av_lockmgr_register removed |
---|---|
Priority: | critical → normal |
Resolution: | → invalid |
Status: | new → closed |
At which point would you expect the mutex to be destroyed?
From that log, it seems you only call the register function once, it creates the two mutex objects it uses, and then just locks/unlocks them. It would only destroy them once you call it again.