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
|
||||
if ((flags & B_CHECK_PERMISSION) != 0
|
||||
&& sSems[slot].u.used.owner == team_get_kernel_team_id()) {
|
||||
dprintf("thread %ld tried to acquire kernel semaphore.\n",
|
||||
thread_get_current_thread_id());
|
||||
dprintf("thread %ld tried to acquire kernel semaphore %ld.\n",
|
||||
thread_get_current_thread_id(), id);
|
||||
status = B_NOT_ALLOWED;
|
||||
goto err;
|
||||
}
|
||||
@@ -618,6 +618,11 @@ err:
|
||||
RELEASE_SEM_LOCK(sSems[slot]);
|
||||
restore_interrupts(state);
|
||||
|
||||
#if 0
|
||||
if (status == B_NOT_ALLOWED)
|
||||
_user_debugger("Thread tried to acquire kernel semaphore.");
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user