[haiku] Re: Any plans for pthread support?

  • From: Colin Günther <coling@xxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Thu, 24 Sep 2009 12:23:14 +0200

Colin Günther schrieb:
Stephan Aßmus schrieb:
Hi,

Colin Günther schrieb:
i had to implement condition variables during my porting effort of FreeBSDs wlan driver. I'm using semaphores to emulating conditional variables behaviour. It turned out, that semaphores are quite useful for that task.

You can take a look of my implementation here: http://dev.osdrawer.net/repositories/changes/haiku-wifi/trunk/wifi/libs/freebsd_network2/kern_condvar.c



Hm, but the kernel already has condition variable support. Was it not possible to use it?

Best regards,
-Stephan

Didn't even research, whether Haiku supports it. I guess I was too happy after understanding how the FreeBSD implementation works, so that i went right into implementing it myself.

Will reconsider the use of Haikus cond var support, now that I'm aware of it. ;-)

As it seems Haikus conditional variable support cannot be used in this case. At some point in the code a conversion of Haiku's "struct mutex" in a "struct _pthread_mutex" is needed. And as far as I can tell this is impossible. Maybe someone else knows better.

So long
Colin

Other related posts: