Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1084
b: refs/heads/master
c: 0f7e663
h: refs/heads/master
v: v3
  • Loading branch information
Bodo Stroesser authored and Linus Torvalds committed May 7, 2005
1 parent fc58187 commit 919b743
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8bd0220c1ac6273eda66e25d992654219f846b6
refs/heads/master: 0f7e663dea7f0e22f3b2d07156c5e9d2e8656610
1 change: 0 additions & 1 deletion trunk/arch/um/kernel/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ void release_thread(struct task_struct *task)

void exit_thread(void)
{
CHOOSE_MODE(exit_thread_tt(), exit_thread_skas());
unprotect_stack((unsigned long) current_thread);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/arch/um/kernel/skas/include/mode_kern-skas.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ extern int copy_thread_skas(int nr, unsigned long clone_flags,
unsigned long sp, unsigned long stack_top,
struct task_struct *p, struct pt_regs *regs);
extern void release_thread_skas(struct task_struct *task);
extern void exit_thread_skas(void);
extern void initial_thread_cb_skas(void (*proc)(void *), void *arg);
extern void init_idle_skas(void);
extern void flush_tlb_kernel_range_skas(unsigned long start,
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/um/kernel/skas/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ void release_thread_skas(struct task_struct *task)
{
}

void exit_thread_skas(void)
{
}

void fork_handler(int sig)
{
change_sig(SIGUSR1, 1);
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/um/kernel/tt/include/mode_kern-tt.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp,
unsigned long stack_top, struct task_struct *p,
struct pt_regs *regs);
extern void release_thread_tt(struct task_struct *task);
extern void exit_thread_tt(void);
extern void initial_thread_cb_tt(void (*proc)(void *), void *arg);
extern void init_idle_tt(void);
extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end);
Expand Down
20 changes: 11 additions & 9 deletions trunk/arch/um/kernel/tt/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ void *switch_to_tt(void *prev, void *next, void *last)
panic("write of switch_pipe failed, err = %d", -err);

reading = 1;
if((from->exit_state == EXIT_ZOMBIE) ||
(from->exit_state == EXIT_DEAD))
if(from->thread.mode.tt.switch_pipe[0] == -1)
os_kill_process(os_getpid(), 0);

err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c));
Expand All @@ -81,8 +80,7 @@ void *switch_to_tt(void *prev, void *next, void *last)
* in case it has not already killed itself.
*/
prev_sched = current->thread.prev_sched;
if((prev_sched->exit_state == EXIT_ZOMBIE) ||
(prev_sched->exit_state == EXIT_DEAD))
if(prev_sched->thread.mode.tt.switch_pipe[0] == -1)
os_kill_process(prev_sched->thread.mode.tt.extern_pid, 1);

change_sig(SIGVTALRM, vtalrm);
Expand All @@ -101,14 +99,18 @@ void release_thread_tt(struct task_struct *task)
{
int pid = task->thread.mode.tt.extern_pid;

/*
* We first have to kill the other process, before
* closing its switch_pipe. Else it might wake up
* and receive "EOF" before we could kill it.
*/
if(os_getpid() != pid)
os_kill_process(pid, 0);
}

void exit_thread_tt(void)
{
os_close_file(current->thread.mode.tt.switch_pipe[0]);
os_close_file(current->thread.mode.tt.switch_pipe[1]);
os_close_file(task->thread.mode.tt.switch_pipe[0]);
os_close_file(task->thread.mode.tt.switch_pipe[1]);
/* use switch_pipe as flag: thread is released */
task->thread.mode.tt.switch_pipe[0] = -1;
}

void suspend_new_thread(int fd)
Expand Down

0 comments on commit 919b743

Please sign in to comment.