Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE

2001-07-02 Thread Cliff Woolley
On Sun, 1 Jul 2001 [EMAIL PROTECTED] wrote:

 Does this solve the warnings?
 If so, please apply.

Two problems:

  (1) My system would never get into the elif because I have both SYSVSEM
and FCNTL serialize:

#define APR_USE_FLOCK_SERIALIZE 0
#define APR_USE_SYSVSEM_SERIALIZE 0
#define APR_USE_FCNTL_SERIALIZE 0
#define APR_USE_PROC_PTHREAD_SERIALIZE 1
#define APR_USE_PTHREAD_SERIALIZE 1

#define APR_HAS_FLOCK_SERIALIZE 0
#define APR_HAS_SYSVSEM_SERIALIZE 1
#define APR_HAS_FCNTL_SERIALIZE 1
#define APR_HAS_PROC_PTHREAD_SERIALIZE 1
#define APR_HAS_RWLOCK_SERIALIZE 0

#define APR_HAS_LOCK_CREATE_NP 1

  (2) pthread_interproc is actually used in crossproc.c

Thanks,
--Cliff



Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE

2001-07-02 Thread rbb

Yeah, I realized #2 while running.  I'll try to log into my solaris box
and fix this tonight.

Ryan

On Sun, 1 Jul 2001, Cliff Woolley wrote:

 On Sun, 1 Jul 2001 [EMAIL PROTECTED] wrote:

  Does this solve the warnings?
  If so, please apply.

 Two problems:

   (1) My system would never get into the elif because I have both SYSVSEM
 and FCNTL serialize:

 #define APR_USE_FLOCK_SERIALIZE 0
 #define APR_USE_SYSVSEM_SERIALIZE 0
 #define APR_USE_FCNTL_SERIALIZE 0
 #define APR_USE_PROC_PTHREAD_SERIALIZE 1
 #define APR_USE_PTHREAD_SERIALIZE 1

 #define APR_HAS_FLOCK_SERIALIZE 0
 #define APR_HAS_SYSVSEM_SERIALIZE 1
 #define APR_HAS_FCNTL_SERIALIZE 1
 #define APR_HAS_PROC_PTHREAD_SERIALIZE 1
 #define APR_HAS_RWLOCK_SERIALIZE 0

 #define APR_HAS_LOCK_CREATE_NP 1

   (2) pthread_interproc is actually used in crossproc.c

 Thanks,
 --Cliff





_
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
-



[Jeff Trawick trawick@attglobal.net] Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE

2001-07-02 Thread Jeff Trawick
(meant to follow up on the list... darn!)

---BeginMessage---
Cliff Woolley [EMAIL PROTECTED] writes:

 Just a heads up on some warnings I'm getting on Solaris 2.6 where
 APR_USE_PROC_PTHREAD_SERIALIZE is selected:
 
 locks.c: In function `apr_os_lock_get':
 locks.c:344: warning: assignment makes pointer from integer without a cast
 locks.c: In function `apr_os_lock_put':
 locks.c:365: warning: assignment makes integer from pointer without a cast
 
 The problem is that (after macro substitution) my apr_os_lock_t looks like
 this:
 
 struct apr_os_lock_t {
 pthread_mutex_t *crossproc;
 pthread_mutex_t *intraproc;
 };
 
 And apr_os_lock_get/put assume that crossproc will be an int (as it is
 with the other serialize methods).
 
 I'd work on this, but it'd probably be easier for somebody who's spent
 more time in the locking code than I have...

I suspect that apr_os_lock_t on Unix needs to look like this...

struct apr_os_lock_t {
#if APR_HAS_PROC_PTHREAD_SERIALIZE
pthread_mutex_t *pthread_crossproc; /* NULL if not used */
#endif
#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || 
APR_HAS_FLOCK_SERIALIZE
int int_crossproc;  /* -1 if not used */
#endif
#if APR_USE_PTHREAD_SERIALIZE
pthread_mutex_t *pthread_intraproc; /* NULL if not used */
#endif
};

In create_lock(), initialize as follows before filling in any lock handles:

#if APR_HAS_PROC_PTHREAD_SERIALIZE
new-pthread_interproc = NULL;
#endif
#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || 
APR_HAS_FLOCK_SERIALIZE
new-interproc = -1;
#endif
#if APR_USE_PTHREAD_SERIALIZE
new-intraproc = NULL;
#endif

in apr_os_lock_get():

#if APR_HAS_PROC_PTHREAD_SERIALIZE
os-pthread_crossproc = lock-pthread_interproc;
#endif
#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || 
APR_HAS_FLOCK_SERIALIZE
os-int_crossproc = lock-interproc;
#endif
#if APR_USE_PTHREAD_SERIALIZE
os-pthread_intraproc = lock-intraproc;
#endif

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
   http://www.geocities.com/SiliconValley/Park/9289/
 Born in Roswell... married an alien...
---End Message---


-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
   http://www.geocities.com/SiliconValley/Park/9289/
 Born in Roswell... married an alien...


Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE

2001-07-02 Thread Jim Jagielski
Hmmm... looks like we don't wrap something with #elif as required.
I dn't have access to a Solaris box, but I'll take a gander.

Cliff Woolley wrote:
 
 
 Just a heads up on some warnings I'm getting on Solaris 2.6 where
 APR_USE_PROC_PTHREAD_SERIALIZE is selected:
 
 locks.c: In function `apr_os_lock_get':
 locks.c:344: warning: assignment makes pointer from integer without a cast
 locks.c: In function `apr_os_lock_put':
 locks.c:365: warning: assignment makes integer from pointer without a cast
 
 The problem is that (after macro substitution) my apr_os_lock_t looks like
 this:
 
 struct apr_os_lock_t {
 pthread_mutex_t *crossproc;
 pthread_mutex_t *intraproc;
 };
 
 And apr_os_lock_get/put assume that crossproc will be an int (as it is
 with the other serialize methods).
 
 I'd work on this, but it'd probably be easier for somebody who's spent
 more time in the locking code than I have...
 
 --Cliff
 


-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
It's *good* to be the King.


Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE

2001-07-02 Thread Cliff Woolley
On 2 Jul 2001, Jeff Trawick wrote:

 struct apr_os_lock_t {
 #if APR_HAS_PROC_PTHREAD_SERIALIZE
 pthread_mutex_t *pthread_crossproc; /* NULL if not used */
 #endif
 #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || 
 APR_HAS_FLOCK_SERIALIZE
 int int_crossproc;  /* -1 if not used */
 #endif
 #if APR_USE_PTHREAD_SERIALIZE
 pthread_mutex_t *pthread_intraproc; /* NULL if not used */
 #endif
 };

 in apr_os_lock_get():

 #if APR_HAS_PROC_PTHREAD_SERIALIZE
 os-pthread_crossproc = lock-pthread_interproc;
 #endif
 #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || 
 APR_HAS_FLOCK_SERIALIZE
 os-int_crossproc = lock-interproc;
 #endif
 #if APR_USE_PTHREAD_SERIALIZE
 os-pthread_intraproc = lock-intraproc;
 #endif


That's essentially what Ryan did last night...


 In create_lock(), initialize as follows before filling in any lock handles:

 #if APR_HAS_PROC_PTHREAD_SERIALIZE
 new-pthread_interproc = NULL;
 #endif
 #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || 
 APR_HAS_FLOCK_SERIALIZE
 new-interproc = -1;
 #endif
 #if APR_USE_PTHREAD_SERIALIZE
 new-intraproc = NULL;
 #endif

We didn't catch this part, though.  The apr_lock_t is pcalloc'ed just
prior to calling create_lock().  Do we really need to do this?  If so,
feel free to add it in...

--Cliff



--
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA




Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE

2001-07-01 Thread rbb

Does this solve the warnings?

Index: locks.h
===
RCS file: /home/cvs/apr/include/arch/unix/locks.h,v
retrieving revision 1.35
diff -u -d -b -w -u -r1.35 locks.h
--- locks.h 2001/07/01 05:49:44 1.35
+++ locks.h 2001/07/01 22:54:09
@@ -150,9 +150,8 @@
 char *fname;
 #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE ||
APR_HAS_FLOCK_SERIALIZE
 int interproc;
-#endif
-#if APR_HAS_PROC_PTHREAD_SERIALIZE
-pthread_mutex_t *pthread_interproc;
+#elif APR_HAS_PROC_PTHREAD_SERIALIZE
+pthread_mutex_t *interproc;
 #endif
 #if APR_HAS_THREADS
 /* APR doesn't have threads, no sense in having an thread lock mechanism.

If so, please apply.

Ryan

On Sun, 1 Jul 2001, Cliff Woolley wrote:


 Just a heads up on some warnings I'm getting on Solaris 2.6 where
 APR_USE_PROC_PTHREAD_SERIALIZE is selected:

 locks.c: In function `apr_os_lock_get':
 locks.c:344: warning: assignment makes pointer from integer without a cast
 locks.c: In function `apr_os_lock_put':
 locks.c:365: warning: assignment makes integer from pointer without a cast

 The problem is that (after macro substitution) my apr_os_lock_t looks like
 this:

 struct apr_os_lock_t {
 pthread_mutex_t *crossproc;
 pthread_mutex_t *intraproc;
 };

 And apr_os_lock_get/put assume that crossproc will be an int (as it is
 with the other serialize methods).

 I'd work on this, but it'd probably be easier for somebody who's spent
 more time in the locking code than I have...

 --Cliff





_
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
-