diff options
| author | Tom Yu <tlyu@mit.edu> | 2011-12-12 20:46:20 +0000 |
|---|---|---|
| committer | Tom Yu <tlyu@mit.edu> | 2011-12-12 20:46:20 +0000 |
| commit | db0db11147deb5767cccb46820401c2754a7ed16 (patch) | |
| tree | 33e3b4cc027b04259070bf3fc4fd860234358d06 /src/ccapi/lib/ccapi_context.c | |
| parent | 8c6030f1d6f8531563297d984848b46b9ede86bf (diff) | |
| download | krb5-db0db11147deb5767cccb46820401c2754a7ed16.tar.gz krb5-db0db11147deb5767cccb46820401c2754a7ed16.tar.xz krb5-db0db11147deb5767cccb46820401c2754a7ed16.zip | |
Split cci_thread_init into per-process and per-thread portions
Call the per-thread code on thread attach and per-process once per
process. Previously, while the function was named 'thread', it was
only actually called once per process. Currently, the per-thread
code does nothing on non-windows platforms and is not even actually
invoked.
Fixes a windows bug when multiple non-main threads try to use ccapi
at the same time.
Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7050
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25569 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi/lib/ccapi_context.c')
| -rw-r--r-- | src/ccapi/lib/ccapi_context.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ccapi/lib/ccapi_context.c b/src/ccapi/lib/ccapi_context.c index a16ce0e58..cf677fc55 100644 --- a/src/ccapi/lib/ccapi_context.c +++ b/src/ccapi/lib/ccapi_context.c @@ -79,12 +79,12 @@ static cc_int32 cci_context_sync (cci_context_t in_context, #pragma mark - #endif -MAKE_INIT_FUNCTION(cci_thread_init); -MAKE_FINI_FUNCTION(cci_thread_fini); +MAKE_INIT_FUNCTION(cci_process_init); +MAKE_FINI_FUNCTION(cci_process_fini); /* ------------------------------------------------------------------------ */ -static int cci_thread_init (void) +static int cci_process_init (void) { cc_int32 err = ccNoError; @@ -93,7 +93,7 @@ static int cci_thread_init (void) } if (!err) { - err = cci_ipc_thread_init (); + err = cci_ipc_process_init (); } if (!err) { @@ -105,9 +105,9 @@ static int cci_thread_init (void) /* ------------------------------------------------------------------------ */ -static void cci_thread_fini (void) +static void cci_process_fini (void) { - if (!INITIALIZER_RAN (cci_thread_init) || PROGRAM_EXITING ()) { + if (!INITIALIZER_RAN (cci_process_init) || PROGRAM_EXITING ()) { return; } @@ -134,7 +134,7 @@ cc_int32 cc_initialize (cc_context_t *out_context, if (!out_context) { err = cci_check_error (ccErrBadParam); } if (!err) { - err = CALL_INIT_FUNCTION (cci_thread_init); + err = CALL_INIT_FUNCTION (cci_process_init); } if (!err) { |
