logo       

cvs: Zend(PHP_4_3) / zend_ini.c: msg#00111

Subject: cvs: Zend(PHP_4_3) / zend_ini.c
wez             Fri Jul 30 11:05:38 2004 EDT

  Modified files:              (Branch: PHP_4_3)
    /Zend       zend_ini.c 
  Log:
  MFH: zts fix for ini entries and dl()
  
  
http://cvs.php.net/diff.php/Zend/zend_ini.c?r1=1.23.2.3&r2=1.23.2.4&ty=u
Index: Zend/zend_ini.c
diff -u Zend/zend_ini.c:1.23.2.3 Zend/zend_ini.c:1.23.2.4
--- Zend/zend_ini.c:1.23.2.3    Fri Jul 18 08:03:50 2003
+++ Zend/zend_ini.c     Fri Jul 30 11:05:38 2004
@@ -141,10 +141,25 @@
        zend_ini_entry *p = ini_entry;
        zend_ini_entry *hashed_ini_entry;
        zval default_value;
+       HashTable *directives = registered_zend_ini_directives;
+
+#ifdef ZTS
+       /* if we are called during the request, eg: from dl(),
+        * then we should not touch the global directives table,
+        * and should update the per-(request|thread) version instead.
+        * This solves two problems: one is that ini entries for dl()'d
+        * extensions will now work, and the second is that updating the
+        * global hash here from dl() is not mutex protected and can
+        * lead to death.
+        */
+       if (directives != EG(ini_directives)) {
+               directives = EG(ini_directives);
+       }
+#endif
 
        while (p->name) {
                p->module_number = module_number;
-               if (zend_hash_add(registered_zend_ini_directives, p->name, 
p->name_length, p, sizeof(zend_ini_entry), (void **) 
&hashed_ini_entry)==FAILURE) {
+               if (zend_hash_add(directives, p->name, p->name_length, p, 
sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
                        zend_unregister_ini_entries(module_number TSRMLS_CC);
                        return FAILURE;
                }

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe