zend_ts_hash_clean not thread-safe?

From: Date: Mon, 16 Apr 2007 17:47:05 +0000
Subject: zend_ts_hash_clean not thread-safe?
Groups: php.internals 
Request: Send a blank email to internals+get-28862@lists.php.net to get a copy of this message
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 )

« previous php.internals (#28862) next »