[beports] Re: POSIX functions


Am 31.08.2008 um 15:21 schrieb Ingo Weinhold:


On 2008-08-31 at 14:46:49 [+0200], Salvatore Benedetto <emitrax@xxxxxxxxx >
wrote:
2008/8/29 Andreas Färber <andreas.faerber@xxxxxx>:
Am 29.08.2008 um 15:33 schrieb Salvatore Benedetto:
But I recently encountered some problems with pthread_cond_broadcast (no ticket yet since I haven't pinpointed it exactly). In a very simple C#
Hello
World app Mono checks for the pthread_cond_broadcast return codes and asserts that they are zero (I assume it runs single-threaded, no Garbage
Collector). If I remove Mono's asserts it works as expected. The
problematic
return code is EINVAL iirc (B_BAD_VALUE), and I traced it to libroot's release_sem_etc, triggered by "if (count <= 0 && (flags & B_RELEASE_ALL)
==
0) return B_BAD_VALUE;".

The condition variable implementation looks indeed not correct -- a
pthread_cond_broadcast() should [not] return an error when no one is waiting. I'll
have a closer look.

Thanks for your fix! My Hello World runs fine now at r27263.

Andreas

--
HaikuPorts homepage - http://ports.haiku-files.org
List archives: http://www.freelists.org/archives/beports
Administrative contact: brecht@xxxxxxxxxxx

Other related posts: