Lock the control pipe mutex before destroying it to ensure that a possibly

still open transfer has enough time to cleanly exit with error. Fixes a crash
when removing a device while a control transfer on the device endpoint was
open and would have timed out otherwise.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25863 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-06-08 14:27:00 +00:00
parent 139e442a62
commit 6236138e25

View File

@ -301,6 +301,7 @@ ControlPipe::~ControlPipe()
{
if (fNotifySem >= 0)
delete_sem(fNotifySem);
mutex_lock(&fSendRequestLock);
mutex_destroy(&fSendRequestLock);
}