You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/11/24 20:06:17 UTC

svn commit: r883816 - in /httpd/httpd/trunk: include/util_mutex.h server/util_mutex.c

Author: trawick
Date: Tue Nov 24 19:06:16 2009
New Revision: 883816

URL: http://svn.apache.org/viewvc?rev=883816&view=rev
Log:
fix Win32 compile failure in r883540, reported by Gregg Smith

(on Win32, external APIs use one calling convention while directive 
parsers use a different one)

Modified:
    httpd/httpd/trunk/include/util_mutex.h
    httpd/httpd/trunk/server/util_mutex.c

Modified: httpd/httpd/trunk/include/util_mutex.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/util_mutex.h?rev=883816&r1=883815&r2=883816&view=diff
==============================================================================
--- httpd/httpd/trunk/include/util_mutex.h (original)
+++ httpd/httpd/trunk/include/util_mutex.h Tue Nov 24 19:06:16 2009
@@ -99,9 +99,9 @@
                                         const char **mutexfile);
 
 /* private function to process the Mutex directive */
-AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
-                                      const char *typelist,
-                                      const char *mechfile);
+const char * ap_set_mutex(cmd_parms *cmd, void *dummy,
+                          const char *typelist,
+                          const char *mechfile);
 
 /**
  * option flags for ap_mutex_register(), ap_global_mutex_create(), and

Modified: httpd/httpd/trunk/server/util_mutex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_mutex.c?rev=883816&r1=883815&r2=883816&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_mutex.c (original)
+++ httpd/httpd/trunk/server/util_mutex.c Tue Nov 24 19:06:16 2009
@@ -160,8 +160,8 @@
     apr_hash_set(mxcfg_by_type, "default", APR_HASH_KEY_STRING, def);
 }
 
-AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
-                                      const char *type, const char *mechdir)
+const char * ap_set_mutex(cmd_parms *cmd, void *dummy,
+                          const char *type, const char *mechdir)
 {
     apr_pool_t *p = cmd->pool;
     apr_lockmech_e mech;



Re: svn commit: r883816 - in /httpd/httpd/trunk: include/util_mutex.h server/util_mutex.c

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> 
> Many if not all other functions which handle directives and which are
> not implemented in the same file as the directive declaration also
> have the ap_ prefix, so I don't follow you on the "public" aspect.

s/public/meant to be exported/

> But most of these other functions are declared with
> AP_DECLARE_NONSTD().  That seems to be appropriate for ap_set_mutex(),
> ap_set_name_virtual_host(), and perhaps others.

AP_DECLARE_NONSTD() really has one goal, which is offering variable arg
lists.  A secondary effect is to use a pure C calling convention, the sort
of thing you might need for some registered callbacks (e.g. atexit, etc).
Otherwise AP_DECLARE() would seem fine.

I think the registered cmd handler might need to be NONSTD.

Re: svn commit: r883816 - in /httpd/httpd/trunk: include/util_mutex.h server/util_mutex.c

Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, Nov 24, 2009 at 2:50 PM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> trawick@apache.org wrote:
>> --- httpd/httpd/trunk/include/util_mutex.h (original)
>> +++ httpd/httpd/trunk/include/util_mutex.h Tue Nov 24 19:06:16 2009
>> @@ -99,9 +99,9 @@
>>                                          const char **mutexfile);
>>
>>  /* private function to process the Mutex directive */
>> -AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
>> -                                      const char *typelist,
>> -                                      const char *mechfile);
>
> If this is a public function (and it is named as one) please revert ;-)

I used ap_set_name_virtual_host() as an example due to its unfortunate
locality to "Mutex" in the list of directives in server/core.c.  It is
also an undecorated "const char *ap_set_name_virtual_host()".

Many if not all other functions which handle directives and which are
not implemented in the same file as the directive declaration also
have the ap_ prefix, so I don't follow you on the "public" aspect.

But most of these other functions are declared with
AP_DECLARE_NONSTD().  That seems to be appropriate for ap_set_mutex(),
ap_set_name_virtual_host(), and perhaps others.

Is that the fix?

Re: svn commit: r883816 - in /httpd/httpd/trunk: include/util_mutex.h server/util_mutex.c

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Nick Kew wrote:
> 
> Regarding r883540 itself, I've just taken a look at it.
> It seems to enforce the same mutex type on all modules that
> use a mutex.  Can't see an obvious reason not to do that, but
> it might merit discussion on-list.  For example, maybe someone
> has a good reason to use different mutex types for a proc
> mutex and a global mutex?

This permits your desired feature, please reread the thread between
Jeff and I, he explained it really well.



Re: svn commit: r883816 - in /httpd/httpd/trunk: include/util_mutex.h server/util_mutex.c

Posted by Nick Kew <ni...@webthing.com>.
William A. Rowe Jr. wrote:
> trawick@apache.org wrote:
>> --- httpd/httpd/trunk/include/util_mutex.h (original)
>> +++ httpd/httpd/trunk/include/util_mutex.h Tue Nov 24 19:06:16 2009
>> @@ -99,9 +99,9 @@
>>                                          const char **mutexfile);
>>  
>>  /* private function to process the Mutex directive */
>> -AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
>> -                                      const char *typelist,
>> -                                      const char *mechfile);
> 
> If this is a public function (and it is named as one) please revert ;-)

Um, it appears to have been introduced in r883540 only yesterday,
and this was a revert (to private).

Regarding r883540 itself, I've just taken a look at it.
It seems to enforce the same mutex type on all modules that
use a mutex.  Can't see an obvious reason not to do that, but
it might merit discussion on-list.  For example, maybe someone
has a good reason to use different mutex types for a proc
mutex and a global mutex?

-- 
Nick Kew

Re: svn commit: r883816 - in /httpd/httpd/trunk: include/util_mutex.h server/util_mutex.c

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
trawick@apache.org wrote:
> --- httpd/httpd/trunk/include/util_mutex.h (original)
> +++ httpd/httpd/trunk/include/util_mutex.h Tue Nov 24 19:06:16 2009
> @@ -99,9 +99,9 @@
>                                          const char **mutexfile);
>  
>  /* private function to process the Mutex directive */
> -AP_DECLARE(const char *) ap_set_mutex(cmd_parms *cmd, void *dummy,
> -                                      const char *typelist,
> -                                      const char *mechfile);

If this is a public function (and it is named as one) please revert ;-)