[asterisk-bugs] [JIRA] Created: (ASTERISK-20286) Incorrect work of __ast_rwlock_timed[rd|wr]lock() functions on OpenBSD
Rusty Newton (JIRA)
noreply at issues.asterisk.org
Mon Aug 20 21:21:07 CDT 2012
Incorrect work of __ast_rwlock_timed[rd|wr]lock() functions on OpenBSD
----------------------------------------------------------------------
Key: ASTERISK-20286
URL: https://issues.asterisk.org/jira/browse/ASTERISK-20286
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Core/Portability
Environment: Open BSD, Mac OS X and similar
Reporter: Egor Gorlin
I faced problem with {{pthread_rwlock_timed\[rd|wr\]lock()}} in my project: these functions are not implemented on OpenBSD/MacOS and similar systems.
Luckily i found the solution in Asterisk (dev/Asterisk/main/lock.c) but it seems to be implemented incorrectly.
In {{pthread_rwlock_timed\[rd|wr\]lock()}} second argument is {{const struct timespec *abs_timeout}}, which represents time since UNIX epoch till timeout.
In {{__ast_rwlock_timed\[rd|wr\]lock()}} implementation for OpenBSD this argument is treated as relative timeout:
difference between {{ast_tvnow()}} and {{struct timeval _start}} is compared to {{abs_timeout}}. That's incorrect.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list