marcus.brinkmann at ruhr-uni-bochum.de
Wed May 5 21:13:11 CEST 2004
At Wed, 05 May 2004 20:36:09 +0200,
Werner Koch wrote:
> On Wed, 05 May 2004 19:35:34 +0200, Marcus Brinkmann said:
> > The asserts in the code check if the proper lock/unlock calls are made
> > in the single-threaded case, too.
> Which is a Good Thing.
> > If the locking interface is exported in gcrypt, and users are
> > responsible for their own locking, these assertions should probably be
> > removed.
> Why? Calling ath_mutex_lock on a locked mutex is a severe error in
> any case.
Yes, but compare it with pthread: you have error checking locks
(robust locks) and fast locks. And everybody just uses the fast locks
and never checks the error.
It's not a good thing if a library gives an assertion failure, unless
there really is an internal error. An error value returned would be
better, but nobody would check it. Oh well.
More information about the Gcrypt-devel