Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28862 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24531 invoked by uid 1010); 16 Apr 2007 17:47:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 24500 invoked from network); 16 Apr 2007 17:47:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2007 17:47:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=marco.cova@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marco.cova@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.239 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: marco.cova@gmail.com X-Host-Fingerprint: 64.233.184.239 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.239] ([64.233.184.239:14515] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/26-18278-F96B3264 for ; Mon, 16 Apr 2007 13:47:13 -0400 Received: by wr-out-0506.google.com with SMTP id i21so1552533wra for ; Mon, 16 Apr 2007 10:47:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=sbmRsno5LfAM9ykwXCSkTHkTpWlkqlRYUFTmC0ZaGdnlMoTVmHJyltlJPCrdWydBeWwmABwnYAeNADMN9urlRJjCbZrq4qWTBfHZusA33EnODydsxVNRHWY56QIXW/hltNyVgKzjjCMiY3IL+BqxwsGX3h+xMT4p0/Y1gTEIkOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=EuIjoT/tQCo27izqCr89X0wdd/ckQkZFe0b7AgvQCi+jXaXwV84z4XCfY+/QTVDB0n43ppTFehZ2kKBs89Bi8r7btbtqH0KXnnPVOoOop62H+yJR/a3H2CxEVDxoH7mbN4hYI2irxRzqIQWzJbNTRqC+iW/wiN9F0M+JGoPsGBc= Received: by 10.114.81.1 with SMTP id e1mr2004145wab.1176745625611; Mon, 16 Apr 2007 10:47:05 -0700 (PDT) Received: by 10.115.73.3 with HTTP; Mon, 16 Apr 2007 10:47:05 -0700 (PDT) Message-ID: Date: Mon, 16 Apr 2007 10:47:05 -0700 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: zend_ts_hash_clean not thread-safe? From: marco.cova@gmail.com ("Marco Cova") 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 )