From: Paolo Bonzini <pbonzini@redhat.com>
To: Brad Smith <brad@comstyle.com>
Cc: blauwirbel@gmail.com, jan.kiszka@siemens.com,
qemu-devel@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/5] semaphore: implement fallback counting semaphores with mutex+condvar
Date: Sun, 18 Nov 2012 17:06:40 +0100 [thread overview]
Message-ID: <50A90790.60007@redhat.com> (raw)
In-Reply-To: <50A8A5BF.3060906@comstyle.com>
Il 18/11/2012 10:09, Brad Smith ha scritto:
> On 11/02/12 09:14, Paolo Bonzini wrote:
>> OpenBSD and Darwin do not have sem_timedwait. Implement a fallback
>> for them.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> qemu-thread-posix.c | 74
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> qemu-thread-posix.h | 6 +++++
>> 2 file modificati, 80 inserzioni(+)
>>
>> diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c
>> index 6a3d3a1..048db8f 100644
>> --- a/qemu-thread-posix.c
>> +++ b/qemu-thread-posix.c
>> @@ -122,36 +122,100 @@ void qemu_sem_init(QemuSemaphore *sem, int init)
>> {
>> int rc;
>>
>> +#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__)
>
> OpenBSD 5.2 & -current (libpthread) / NetBSD -current (librt) have
> supported sem_timedwait() for roughly 8 months now. Please change this
> to properly test for the presence of sem_timedwait() within the
> configure script.
Please submit a patch. The patched code works, and it's not even
suboptimal because *BSD use a mutex/condvar to implement semaphores. We
end up executing the very same code.
Paolo
next prev parent reply other threads:[~2012-11-18 16:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 13:14 [Qemu-devel] [PATCH 0/5] Fixes for thread pool patches Paolo Bonzini
2012-11-02 13:14 ` [Qemu-devel] [PATCH 1/5] compiler: support Darwin weak references Paolo Bonzini
2012-11-02 13:46 ` Peter Maydell
2012-11-02 13:14 ` [Qemu-devel] [PATCH 2/5] semaphore: implement fallback counting semaphores with mutex+condvar Paolo Bonzini
2012-11-02 13:50 ` Peter Maydell
2012-11-18 9:09 ` Brad Smith
2012-11-18 16:06 ` Paolo Bonzini [this message]
2012-11-27 2:56 ` Brad Smith
2012-11-02 13:14 ` [Qemu-devel] [PATCH 3/5] qemu-timer: reinitialize timers after fork Paolo Bonzini
2012-11-02 13:14 ` [Qemu-devel] [PATCH 4/5] vl: unify calls to init_timer_alarm Paolo Bonzini
2012-11-02 13:14 ` [Qemu-devel] [PATCH 5/5] vl: delay thread initialization after daemonization Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50A90790.60007@redhat.com \
--to=pbonzini@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=brad@comstyle.com \
--cc=jan.kiszka@siemens.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).