[Ace-users] Re: [ace-bugs] [ACE Autoconf setup]: [ACE_HAS_POSIX_SEM_TIMEOUT neverdefined under LINUX]

Johnny Willemsen jwillemsen at remedy.nl
Sat Jul 28 08:36:14 CDT 2007


Hi,

Thanks for using the PRF form. When you have registered for bugzilla you
will get an email explaining how to get permissions, you have to get it from
WashU admin.

Please add your changes to bugzilla, we can then fix this problem asap.
Thanks already for figuring out the patch.

Regards,

Johnny Willemsen
Remedy IT
Postbus 101
2650 AC  Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl  

*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO             ***
*** See http://www.theaceorb.nl/en/support.html                 *** 

> -----Original Message-----
> From: ace-bugs-bounces at cse.wustl.edu 
> [mailto:ace-bugs-bounces at cse.wustl.edu] On Behalf Of Peter Korf
> Sent: Saturday, July 28, 2007 11:43 AM
> To: ace-bugs at cse.wustl.edu
> Subject: [ace-bugs] [ACE Autoconf setup]: 
> [ACE_HAS_POSIX_SEM_TIMEOUT neverdefined under LINUX]
> 
> Hi,
> 
>  This problem is simular to BUG# 2836 - but here are two patches.
>  And I'm not permitted to edit bugs in product ACE, so I can 
> not attach them.
> 
>    ACE VERSION: 5.5.9
> 
>    HOST MACHINE and OPERATING SYSTEM:
>    Linux 2.6.18.8-0.3-default #1 SMP
>    x86_64 x86_64 x86_64 GNU/Linux
>    SuSE 10.2
> 
>    COMPILER NAME AND VERSION (AND PATCHLEVEL):
>    gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)
> 
>     SYNOPSIS:
> Neither ACE_HAS_POSIX_SEM_TIMEOUT or 
> ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION can 
> be defined using ./configure, because there is no AC_DEFINE for it.
> 
>     DESCRIPTION:
> Using the traditional build (not with ./configure) everything 
> works fine.
> But using the ./configure script ACE_HAS_POSIX_SEM_TIMEOUT 
> will not defined, 
> because there is no test or anything in configure.ac for it.
> 
> In the traditional build this definition is set to 1 under Linux.
> 
> Without ACE_HAS_POSIX_SEM_TIMEOUT ACE will not wait on a 
> timed out acquire for 
> a semaphore.
> 
> This problem should be reproducible on all systems defining 
> ACE_HAS_POSIX_SEM 
> and using the configure script.
> 
> 
>     REPEAT BY:
> Write a program containing this:
>   ACE_Time_Value tv = ACE_Time_Value(10) + ACE_OS::gettimeofday();
>   ACE_Semaphore* sem = new ACE_Semaphore(0);
>   
>   sem->acquire(tv); // <-- should wait 10 seconds
> 
>   delete sem;
> 
> Using ./configure the program will not stop for 10 seconds. 
> Without using ./configure it will wait.
> 
>    PATCHES:
> --- ACE-5.5.9_orig/ACE_wrappers/configure.ac      2007-05-24 
> 05:45:22.000000000 +0000
> +++ ACE-5.5.9/ACE_wrappers/configure.ac   2007-07-27 
> 06:16:11.000000000 +0000
> @@ -4405,6 +4405,10 @@
>      ,
>      [AC_DEFINE([ACE_LACKS_CONDATTR_PSHARED])])
> 
> +  AC_CHECK_FUNC([pthread_cond_timedwait],
> +    [AC_DEFINE([ACE_HAS_POSIX_SEM_TIMEOUT])],
> +    [AC_DEFINE([ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION])])
> +
>    AC_CHECK_FUNC([pthread_attr_setstackaddr],
>      ,
>      [AC_DEFINE([ACE_LACKS_THREAD_STACK_ADDR])])
> 
> --- ACE-5.5.9_orig/ACE_wrappers/m4/config_h.m4    2006-12-14 
> 00:14:22.000000000 +0000
> +++ ACE-5.5.9/ACE_wrappers/m4/config_h.m4 2007-07-27 
> 06:43:41.000000000 +0000
> @@ -516,6 +516,12 @@
>  [Platform supports POSIX real-time semaphores (e.g., VxWorks and
>     Solaris)])
> 
> +AH_TEMPLATE([ACE_HAS_POSIX_SEM_TIMEOUT],
> +[Compiler supports timed mutex acquisitions (e.g. 
> pthread_mutex_timedlock()).])
> +
> +AH_TEMPLATE([ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION],
> +[Emulation for timed mutex acquisitions.])
> +
>  AH_TEMPLATE([ACE_HAS_POSIX_TIME],
>  [Platform supports the POSIX struct timespec type])
> 
> IMPORTANT NOTES:
> I don't know what ACE_HAS_POSIX_SEM_TIMEOUT_EMULATION is for, 
> but it looks 
> OK, if its defined here.
> Or the else entry in AC_CHECK_FUNC should be left empty.
> 
> This is only tested on one system under one operating system!
> 
> (Don't forget to run autoheader and autoconf after applying 
> the patches)
> 
> Thanks for developing and maintaing ACE,
> Peter
> 
> _______________________________________________
> ace-bugs mailing list
> ace-bugs at mail.cse.wustl.edu
> http://mail.cse.wustl.edu/mailman/listinfo/ace-bugs
> 



More information about the Ace-users mailing list