From dev-return-4968-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu Nov 29 00:29:50 2001 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 24451 invoked by uid 500); 29 Nov 2001 00:29:50 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 24440 invoked from network); 29 Nov 2001 00:29:50 -0000 Date: Wed, 28 Nov 2001 16:29:58 -0800 From: Aaron Bannert To: dev@apr.apache.org Subject: Re: race condition in apr_uuid_get Message-ID: <20011128162957.D18738@clove.org> Mail-Followup-To: Aaron Bannert , dev@apr.apache.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Wed, Nov 28, 2001 at 04:21:21PM -0800, Doug MacEachern wrote: > 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(); Would apr_thread_once help here, in addition to the normal mutex routines? -aaron