[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: dangerous hash usage?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-09-24 22:08:14 CEST

Ben Collins-Sussman <sussman@collab.net> writes:

> Working on #1075, I noticed this:
>
> I see code in svn which loops over an apr_hash_t, yet code within the
> loop potentially removes an item from the hash. Isn't this
> dangrerous? Can't this mess up the hash iterator (apr_hash_index_t)?
>
> In particular, I'm looking at libsvn_wc/adm_ops.c:121.

Hm, I shoulda checked the APR docs. They say:

 * @remark There is no restriction on adding or deleting hash entries during
 * an iteration (although the results may be unpredictable unless all you do
 * is delete the current entry) and multiple iterations can be in
 * progress at the same time.

So unbelievably, I guess that code is safe. Never mind.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 24 22:09:55 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.