vkernel: Fix startup race with I/O cothread support.
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 1 Apr 2009 03:32:22 +0000 (20:32 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 1 Apr 2009 03:32:22 +0000 (20:32 -0700)
commit65905e942cb9cbcc7087a8e952104e249aa33281
treeebac23a42c575880b57c5b6a5cc83848e6cce04b
parentc260943236095839a0bbe73688b38f5585493e2f
vkernel: Fix startup race with I/O cothread support.

The cothread interlocks using pthread calls but there is a small window
of opportunity where a cpu thread can signal the cothread before the
cothread has managed to interlock its first wait.  Moving the wait from the
top of the loop to the bottom fixes the problem.

Reported-by: Joe Talbott <josepht@cstone.net>
sys/dev/virtual/disk/vdisk.c
sys/platform/vkernel/platform/cothread.c