From: James Courtier-D. <Ja...@su...> - 2002-09-12 15:14:45
|
Guenter Bartsch wrote: >hi there, > > > >>Sounds really good. Isn't xine_config_lookup_entry a candidate for this? >>No we have an internal slot in the config structure, where the entry >>from the lookup is copied to and then a pointer to this slot is handed >>out. This can be problematic, when we have two calls to >>xine_config_lookup_entry from different threads, because one would >>overwrite the config entry the other has requested. Allocating and >>copying them on the caller's stack in xine_config_lookup_entry should >>be a lot safer. >> >> > >introducing a mutex here would be even better and much simpler and would >also solve the concurrent write problems daniel mentioned > >cheers, > > guenter > > > Wow! I should have thought of that. The entire config system needs mutex locks for force serialisation of transactions. I.e. lock register entry (calls lookup) update entry (calls lookup) unlock. It is probably due to lack of locks which is why I am seeing the malloc/free segfaults. Cheers James |