From: Alex P. <pes...@ma...> - 2011-03-29 06:25:06
|
On 03/28/11 23:26, Adriano dos Santos Fernandes wrote: > On 28-03-2011 04:36, Alex Peshkoff wrote: >> Certainly, more clever helper object can solve a problem. But I do not >> see a way to build it without lock. And I claim that this is too high >> price for removing reference counters from API. >> > I must say here that if you're going to create proxy objects that do: > if (x) > x->something(); > > And concurrently do: > x = NULL; > > let saying, "x" is a Jrd::Attachment or a jrd_tra, this is VERY incorrect. Certainly. But if concurrently we have a call that makes x to become invalid pointer (detach/drop/commit/rollback when used without refCounted objects), this has same effect as x = NULL; |