apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject apr_threadkey
Date Sun, 29 Apr 2001 19:41:14 GMT
it looks like apr_threadkey_t cannot be used as tls is meant to be.  for
example:

static apr_threadkey_t *thr_key;

static void hook_post_config(apr_pool_t *pconf, ...)
{
     apr_threadkey_private_create(&thr_key, NULL, pconf);
}

it is not possible to use thr_key at request time because 
apr_threadkey_private_{get,set} use apr_pool_userdata_{get,set}, rather
than pthread_{get,set}specific.  so we have concurrent threads hitting the
same pool, rendering the apr_threadkey_private api useless.
i would have expected that apr_threadkey_create registers a cleanup to
delete the key and that apr_threadkey_private_{get,set} do not touch
the pool, but use pthread_{get,set}specific (or platform equivs)
is it just the case that the implementation has not been completed or just
an oversight or am i totally missing something?



Mime
View raw message