Better means to debug apps that try to acquire kernel semaphores.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16695 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -499,8 +499,8 @@ switch_sem_etc(sem_id semToBeReleased, sem_id id, int32 count,
|
|||||||
// doesn't have any use outside the kernel
|
// doesn't have any use outside the kernel
|
||||||
if ((flags & B_CHECK_PERMISSION) != 0
|
if ((flags & B_CHECK_PERMISSION) != 0
|
||||||
&& sSems[slot].u.used.owner == team_get_kernel_team_id()) {
|
&& sSems[slot].u.used.owner == team_get_kernel_team_id()) {
|
||||||
dprintf("thread %ld tried to acquire kernel semaphore.\n",
|
dprintf("thread %ld tried to acquire kernel semaphore %ld.\n",
|
||||||
thread_get_current_thread_id());
|
thread_get_current_thread_id(), id);
|
||||||
status = B_NOT_ALLOWED;
|
status = B_NOT_ALLOWED;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -618,6 +618,11 @@ err:
|
|||||||
RELEASE_SEM_LOCK(sSems[slot]);
|
RELEASE_SEM_LOCK(sSems[slot]);
|
||||||
restore_interrupts(state);
|
restore_interrupts(state);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (status == B_NOT_ALLOWED)
|
||||||
|
_user_debugger("Thread tried to acquire kernel semaphore.");
|
||||||
|
#endif
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user