On Saturday 30 June 2007 19:27, Anders Olofsson wrote: > After looking at the lock handling that is used for user and owner > objects (and possible other daemon resources as well) I've seen that the > DropUser() calls appear everywhere cluttering up the code and are easy > to forget when coding. > > I think it would be preferable to use guard classes. (I don't know if > this is the correct term but it's what they're called at work for our > mutex handling.)
We have some work like that for the Mutex class in the new API. And yes, it will need to be in the new API for fetching users, or anything else that requires a mutex. > I'm not sure if this is something to add to the current daemon or if it > should be part of the new API only, but my vote is on the current code > as it is not much work but makes lock handling so much easier. I wouldn't bother adding it to the current code. It has been that way for around 8 years. And there won't be that much work done being added that locks/unlocks users. Jon -- ________________________________________________________ Jon Keating ICQ: 16325723 [EMAIL PROTECTED] MSN: [EMAIL PROTECTED] http://www.licq.org GPG: 2290A71F http://www.thejon.org HOME: Minamiashigara, Japan
