[asterisk-bugs] [Asterisk 0014930]: [patch] Detect pthread_rwlock_timedwrlock() before usage

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Apr 18 19:51:10 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14930 
====================================================================== 
Reported By:                tilghman
Assigned To:                mvanbaak
====================================================================== 
Project:                    Asterisk
Issue ID:                   14930
Category:                   Core/ManagerInterface
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 189137 
Request Review:              
====================================================================== 
Date Submitted:             2009-04-18 09:11 CDT
Last Modified:              2009-04-18 19:51 CDT
====================================================================== 
Summary:                    [patch] Detect pthread_rwlock_timedwrlock() before
usage
Description: 
On Saturday 18 April 2009 05:48:40 Michiel van Baak wrote:
> Tilghman recently committed a fix for bug 14705.
> This patch uses pthread_rwlock_timed[(wr)|(rd)]lock
>
> Those functions are not available on OpenBSD.
> Now we have no version of asterisk that compiles anymore.
>
> Any idea how to fix this other then reverting this one revision (which
> makes asterisk compile fine again on OpenBSD)

Possibly.  We could do a detection for this function in autoconf and
implement
a poor man's busy-loop using pthread_rwlock_trywrlock, assuming you have
that
function.
====================================================================== 

---------------------------------------------------------------------- 
 (0103412) mvanbaak (manager) - 2009-04-18 19:51
 http://bugs.digium.com/view.php?id=14930#c103412 
---------------------------------------------------------------------- 
the AC_COMPILE_IFELSE should be a AC_LINK_IFELSE
gcc in compile only mode will simply ignore undefined functions. You have
to actually link it to find the missincg function.

once I have done that I get:
   [CC] hashtest2.c -> hashtest2.o
In file included from hashtest2.c:39:
/home/michiel/src/asterisk/skinny-subs/include/asterisk/lock.h: In
function `ast_rwlock_timedwrlock':
/home/michiel/src/asterisk/skinny-subs/include/asterisk/lock.h:1844:
error: request for member `tv_sec' in something not a structure or union
/home/michiel/src/asterisk/skinny-subs/include/asterisk/lock.h:1844:
error: request for member `tv_sec' in something not a structure or union
/home/michiel/src/asterisk/skinny-subs/include/asterisk/lock.h:1844:
error: request for member `tv_nsec' in something not a structure or union
gmake[1]: *** [hashtest2.o] Error 1
gmake: *** [utils] Error 2
$ 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-04-18 19:51 mvanbaak       Note Added: 0103412                          
======================================================================




More information about the asterisk-bugs mailing list