FAQ
Hi all.

It seems that zend_ts_hash_clean is not actually thread-safe: it
delegates to zend_hash_clean without first acquiring the write lock on
the hashtable.

Is this behavior an oversight (if so, should I open a bug report with
the trivial patch below?) or is this intentional?

Marco

--- zend_ts_hash.c.orig 2007-04-16 10:27:24.000000000 -0700
+++ zend_ts_hash.c 2007-04-16 10:28:44.000000000 -0700
@@ -90,8 +90,10 @@

ZEND_API void zend_ts_hash_clean(TsHashTable *ht)
{
+ begin_write(ht);
ht->reader = 0;
zend_hash_clean(TS_HASH(ht));
+ end_write(ht);
}

ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nK
eyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC
)

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedApr 16, '07 at 5:47p
activeApr 16, '07 at 5:47p
posts1
users1
websitephp.net

1 user in discussion

Marco Cova: 1 post

People

Translate

site design / logo © 2023 Grokbase