Added support for library initialization and finalization, and verification
authorKen Raeburn <raeburn@mit.edu>
Sat, 24 Apr 2004 21:09:44 +0000 (21:09 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 24 Apr 2004 21:09:44 +0000 (21:09 +0000)
commitfcf02bef88a17724aa230547459a9eaf1159d6c1
tree7f9dd998b8e7baf61111f6bf0428da47de1291eb
parent3b4d753fc5169469da270c831654a8fae407cfdf
Added support for library initialization and finalization, and verification
that the initializer completed successfully.  Delay initialization on POSIX
until the first "verification" call.  Currently specific to a few platforms,
but should still build on others without thread support enabled.

Use it to finish creating (if necessary) and destroy mutexes, and free some
other storage "permanently" allocated by libraries (currently, libkrb5
cache/keytab type registries only).  Change initialization of static mutexes to
a two-step operation, a static "partial" initializer and a "finish_init"
routine called from a thread-safe environment like library initialization is
assumed to be.  POSIX will use the former, Windows will use the latter, and the
debug support will check that *both* have been used.

Added init/fini functions to com_err, profile, krb5, and gssapi libraries.
(The profile library one may need to be removed later.)  The existing ones, not
thread-safe, are still around.

Use weak symbol support if available to figure out if the pthread library has
been linked in, and avoid calling certain routines if the C library stubs are
known not to exist or work.

Stub declarations for thread-specific data.
Minor bugfixes, whitespace changes.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16268 dc483132-0cff-0310-8789-dd5450dbe970
29 files changed:
src/ChangeLog
src/aclocal.m4
src/include/ChangeLog
src/include/Makefile.in
src/include/k5-platform.h
src/include/k5-thread.h
src/lib/gssapi/ChangeLog
src/lib/gssapi/generic/ChangeLog
src/lib/gssapi/generic/gssapiP_generic.h
src/lib/gssapi/gss_libinit.c
src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/krb5_gss_glue.c
src/lib/krb5/ChangeLog
src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/ccbase.c
src/lib/krb5/keytab/ChangeLog
src/lib/krb5/keytab/ktbase.c
src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/init_ctx.c
src/lib/krb5/krb5_libinit.c
src/lib/krb5/rcache/ChangeLog
src/lib/krb5/rcache/rc_base.c
src/util/et/ChangeLog
src/util/et/Makefile.in
src/util/et/error_message.c
src/util/et/error_table.h
src/util/profile/ChangeLog
src/util/profile/prof_file.c
src/util/profile/prof_int.h