]> git.sesse.net Git - vlc/commit
Keep the bank lock until plugins are loaded.
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 17 Feb 2009 21:28:40 +0000 (23:28 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 17 Feb 2009 21:28:40 +0000 (23:28 +0200)
commit247685e30aacb74925c486928844aff52d46874e
treec9d4ed73b326b64a9ef8e3845abcbf4ab1a60cc4
parenta6acf806b45fdbb7244297faaf0e902811c9e6d3
Keep the bank lock until plugins are loaded.

This is a bit ugly but it fixes two race conditions:
 - loading plugins while another thread is initializing,
 - using the bank when the first thread has not completed loading plugins.

Unfortunately, there is still a small race when module_need() calls
AllocatePlugin(). It really should not -need to- do that, but the fix would
be quite invasive. We would basically need to store plugin callbacks by names
rather than function pointers. Then the module descriptors would be fully
serializable, so we would not need to re-describe plugins when loading their
shared object. That would also fix the last known corruption bug in the plugins
cache.
src/libvlc.c
src/modules/modules.c
src/modules/modules.h