[haiku] Re: Any plans for pthread support?

  • From: Colin Günther <coling@xxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sat, 26 Sep 2009 18:53:04 +0200

Ingo Weinhold schrieb:
On 2009-09-25 at 12:35:30 [+0800], Ryan Leavengood <leavengood@xxxxxxxxx> wrote:
On Thu, Sep 24, 2009 at 6:23 AM, Colin Günther <coling@xxxxxx> wrote:
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.
From this it sounds like you were trying to use the pthread condition
variables, but Stephan was talking about the kernel condition
variables, in other words: src/system/kernel/condition_variable.cpp.

Since AFAIK you are in kernel-land this is probably what you would
want to use. Of course I don't know if that is considered a "public
kernel API" or what the general policy is on using parts of the kernel
code like that in drivers.

The header is headers/private/kernel/condition_variable.h, so it's a kernel private API ATM. Drivers in the Haiku repository are free to use it (and are encouraged to do so, if they need a condition variable API); they will be adjusted accordingly, when (if) the API changes. Hoping that the atheros driver will make it into the Haiku repository eventually, I'd say using kernel private API is fine for it, too.

CU, Ingo

That is good to know. Especially because I'm hoping to get the updated FreeBSD compatibility layer into Haiku's repository, first. But that's another topic and worth it's own post, which I'm preparing. What I can tell from glimpsing through condition_variable.h and some source code usages of it is, that it should be possible to use it. And it would make me feel better, too, when I can exchange my lesser tested implementation with this more mature code.

Colin

Other related posts: