activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mittler, Nathan" <>
Subject RE: CMS supports bytes messages
Date Tue, 25 Apr 2006 16:10:04 GMT
Hey Hiram,
It's surprising that OS X doesn't support recursive locks - I thought
they were a standard part of pthreads.  Even more surprising is when you
try to lock twice from the same thread, it deadlocks itself :)

I am in total agreement about sprinkling #ifdefs around the code - it's
ugly and we'll have to keep tweaking them to support new platforms.  But
I don't think there is a way that we can get rid of them - it's just one
of the many nasty parts of coding in C++.  Even with autoconf you still
have to have them there - autoconf just picks which ones to enable based
on your environment.  I'm definitely open to suggestions.


-----Original Message-----
From: [] On Behalf Of Hiram
Sent: Tuesday, April 25, 2006 11:48 AM
Subject: Re: CMS supports bytes messages

Hi Nathan,

I assume you've committed that patch to SVN by now.
I was just testing the latest cms against the latest activemq on OS X
and ran into an issue where the client was hanging in the 
StompTransport::addMessageListener call.

Root cause: the mutex being used did not seem to support recursive

The following patch fixes the issue for me.  I'll commit it as soon as
SVN starts working again.
I'm not feeling very good about sprinkling all these if defs around
the code.  I'm sure we are going to have to update these constantly as
we support more platforms.  Would using autoconfig help us with these

Index: activemqcms/src/activemq/concurrent/Mutex.h
--- activemqcms/src/activemq/concurrent/Mutex.h (revision 396884)
+++ activemqcms/src/activemq/concurrent/Mutex.h (working copy)
@@ -47,9 +47,9 @@
            pthread_mutexattr_t attributes;
            pthread_mutexattr_init( &attributes );

-            #ifdef __USE_UNIX98
+       #if defined(__USE_UNIX98) || defined(__APPLE__)
                pthread_mutexattr_settype( &attributes,
-            #endif
+       #endif

            // Initialize the mutex.
            pthread_mutex_init( &mutex, &attributes );

On 4/23/06, Nathan Mittler <> wrote:
> I know a few of people were waiting for feedback on this - so I'm
sending to
> both lists.  I've just submitted a couple of patches to the stomp C++
> (CMS).  One fixes the way it was handling the broker url, and the
> fixes the handling of the bytes message.  It all looks good now - I
> against the April 19th incubator snapshot of AMQ.  You'll need a
> version of the broker as there have been a few patches made on the
> interface.
> Regards,
> Nate


View raw message