On 05/16/11 21:00, Vlad Khorsun wrote:
>
>     We can introduce some special mode to report such errors using exceptions,
> or write message into log, or even provide callback for debugging purposes.
>
>     But Adriano's question was about *semantics*. So, do you agree with me 
> that
> explicit detach() must be called by good code and not just release() ? And 
> that
> call of release() when refCount == 1 is a bug in caller's code ?

My initial thinking was - for objects, that have explicit dtor functions
(detach/commit/etc.), explicit dtor() must be called by good code and
not just release().

But calling release() with refCount == 1 is not always bug. It's
(logically) like handling errors in dtors - sometimes it's better to
ignore error in dtor cause it can be already called due to another
error. And if some thread needs to tell to the object - I do not need
you any more, I anyway can't handle an error if it happens, why not let
it call release()? As I've already said, logically this does not differ
from lost network connection.



------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to