Subject: Re: Kernel semaphore API
To: Andrew Doran <ad@netbsd.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 03/29/2007 08:14:51
On Mar 29, 2007, at 5:13 AM, Andrew Doran wrote:

> Hi,
>
> Here's an API for counting semaphores in the kernel. It's similar  
> to what we
> have now for condition variables.

What's your planned usage of this API?

>
> Any comments?
>
> Thanks,
> Andrew
>
> void    sema_init(ksema_t *sem, const char *wmesg, u_int value);
> void    sema_destroy(ksema_t *sem);
>
> void    sema_wait(ksema_t *sem);
> int     sema_wait_sig(ksema_t *sem);
> int     sema_timedwait(ksema_t *sem, u_int ticks);
> int     sema_timedwait_sig(ksema_t *sem, u_int ticks);
>
> bool    sema_try(ksema_t *sem);
>
> void    sema_post(ksema_t *sem);

-- thorpej