* Added SIGNAL_FLAG_DONT_RESTART_SYSCALL for send_signal_etc() which

utilizes the THREAD_FLAG_DONT_RESTART_SYSCALL (but only in SIGCONT
  for now).
* resume_thread() is now using that flag to be compatible with BeOS.
* This fixes the Terminal hanging on close.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-02-21 13:19:54 +00:00
parent 47d3c50607
commit 0dd3108ca0
3 changed files with 11 additions and 4 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2007, Axel Dörfler, [email protected]. All rights reserved.
* Copyright 2003-2008, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_SIGNAL_H
@@ -15,8 +15,9 @@
#define SIGNAL_TO_MASK(signal) (1LL << (signal - 1))
// additional send_signal_etc() flag
#define SIGNAL_FLAG_TEAMS_LOCKED (0x10000)
#define SIGNAL_FLAG_TEAMS_LOCKED (0x10000)
// interrupts are disabled and team lock is held
#define SIGNAL_FLAG_DONT_RESTART_SYSCALL (0x20000)
#ifdef __cplusplus
+3
View File
@@ -499,6 +499,9 @@ deliver_signal(struct thread *thread, uint signal, uint32 flags)
if (thread->state == B_THREAD_SUSPENDED)
scheduler_enqueue_in_run_queue(thread);
if ((flags & SIGNAL_FLAG_DONT_RESTART_SYSCALL) != 0)
atomic_or(&thread->flags, THREAD_FLAGS_DONT_RESTART_SYSCALL);
atomic_and(&thread->sig_pending, ~STOP_SIGNALS);
// remove any pending stop signals
break;
+5 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007, Axel Dörfler, [email protected].
* Copyright 2002-2008, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -2345,7 +2345,10 @@ resume_thread(thread_id id)
if (id <= 0)
return B_BAD_VALUE;
return send_signal(id, SIGCONT);
return send_signal_etc(id, SIGCONT, SIGNAL_FLAG_DONT_RESTART_SYSCALL);
// This retains compatibility to BeOS which documents the
// combination of suspend_thread() and resume_thread() to
// interrupt threads waiting on semaphores.
}