[1817] in Kerberos_V5_Development
Re: Krb5 Ccache DLL proposal
daemon@ATHENA.MIT.EDU (Barry Jaspan)
Sat Sep 28 00:17:20 1996
Date: Sat, 28 Sep 1996 00:16:47 -0400
From: "Barry Jaspan" <bjaspan@MIT.EDU>
To: tytso@MIT.EDU
Cc: tytso@MIT.EDU, mikec@geek.grf.ov.com, harryc@cam.ov.com, pbh@MIT.EDU,
krbdev@MIT.EDU, dosdev@MIT.EDU
In-Reply-To: <9609272240.AA24452@dcl.MIT.EDU> (tytso@MIT.EDU)
- What happens if you call cc_lock multiple times?
"Behavior undefined"; the caller shouldn't do that.
I found that to be an unworkable decision when I wrote the kadm5
database layer. That too has explicit locking functions for locks
that need to span multiple calls, but also has implicit locking for
each api function. Since the api functions use the same lock
function, it ends up being called multiple times concurrently. Also,
sometimes the caller has a shared lock, but the called api function
needs a temporary write lock.
Certainly, you could implement this behavior by having a separate
internal lock function, or "if it is already locked, don't lock it
again." The latter, however, is basically the same as a refcnt inside
the lock handle, so perhaps it would be better to just imlpement that
ref counting once in the library.
Or maybe not. :-)
Barry