On Wed, Jun 4, 2014 at 2:00 PM, M Farkas-Dyck <strake...@gmail.com> wrote: > Would a rwlock do? The sender and recver operate asynchronously, so > the sender needs to hold a lock while sending and release it when > asleep, but it can't be a mutex as the send operation may sleep, so I > used requ.ready as the lock, but a rwlock seems appropriate.
msleep() unlocks the mutex after the process is placed on the sleep queue, and then relocks the mutex after being woken up. I would expect that should be sufficient for your use case, but I haven't looked close enough. Style nits: Please keep source files ASCII; i.e., "Copyright (C)" instead of the Unicode copyright character. Also, look at "man 9 style"; in particular, OpenBSD doesn't put spaces around "->" and we keep lines under 80 characters long. Oh, and no "static" functions in the kernel. They cause problems with ddb.