apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject race condition in apr_uuid_get
Date Thu, 29 Nov 2001 00:21:21 GMT
i seem to recall mention of apr_uuid having thread issues, but couldn't
find anything in the STATUS file or archives.  anyhoo, any thoughts on
solving the race condition here:

srclib/apr/misc/unix/getuuid.c:

static int uuid_state_seqnum;
static unsigned char uuid_state_node[NODE_LENGTH] = { 0 };
...
static void init_state(void)
{
    uuid_state_seqnum = true_random();
    get_pseudo_node_identifier(uuid_state_node);
}

APR_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid)
{
    ...
    if (!uuid_state_node[0])
        init_state();


Mime
View raw message