diff options
author | tanimura <tanimura@FreeBSD.org> | 2002-02-23 11:12:57 +0000 |
---|---|---|
committer | tanimura <tanimura@FreeBSD.org> | 2002-02-23 11:12:57 +0000 |
commit | a09da298590e8c11ebafa37f79e0046814665237 (patch) | |
tree | 2289c653c0f7aa23498f82b603c33107952652ec /sys/i386/isa/pcvt | |
parent | 33e8ee5265ca2838260ab581a9cebdedb1e1e29b (diff) | |
download | FreeBSD-src-a09da298590e8c11ebafa37f79e0046814665237.zip FreeBSD-src-a09da298590e8c11ebafa37f79e0046814665237.tar.gz |
Lock struct pgrp, session and sigio.
New locks are:
- pgrpsess_lock which locks the whole pgrps and sessions,
- pg_mtx which protects the pgrp members, and
- s_mtx which protects the session members.
Please refer to sys/proc.h for the coverage of these locks.
Changes on the pgrp/session interface:
- pgfind() needs the pgrpsess_lock held.
- The caller of enterpgrp() is responsible to allocate a new pgrp and
session.
- Call enterthispgrp() in order to enter an existing pgrp.
- pgsignal() requires a pgrp lock held.
Reviewed by: jhb, alfred
Tested on: cvsup.jp.FreeBSD.org
(which is a quad-CPU machine running -current)
Diffstat (limited to 'sys/i386/isa/pcvt')
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_out.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_sup.c | 5 |
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_out.c b/sys/i386/isa/pcvt/pcvt_out.c index e891b4c..8c77933 100644 --- a/sys/i386/isa/pcvt/pcvt_out.c +++ b/sys/i386/isa/pcvt/pcvt_out.c @@ -1582,8 +1582,11 @@ set_emulation_mode(struct video_state *svsp, int mode) svsp->scrr_end = svsp->scrr_len - 1; } - if (svsp->vs_tty && svsp->vs_tty->t_pgrp) + if (svsp->vs_tty && svsp->vs_tty->t_pgrp) { + PGRP_LOCK(svsp->vs_tty->t_pgrp); pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1); + PGRP_UNLOCK(svsp->vs_tty->t_pgrp); + } } /*---------------------------------------------------------------------------* @@ -1867,8 +1870,11 @@ vt_col(struct video_state *svsp, int cols) (cols == SCR_COL80)? 720: 1056; svsp->vs_tty->t_winsize.ws_ypixel = 400; - if(svsp->vs_tty->t_pgrp) + if(svsp->vs_tty->t_pgrp) { + PGRP_LOCK(svsp->vs_tty->t_pgrp); pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1); + PGRP_UNLOCK(svsp->vs_tty->t_pgrp); + } } reallocate_scrollbuffer(svsp, svsp->scrollback_pages); diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c index 7fde462..4df2971 100644 --- a/sys/i386/isa/pcvt/pcvt_sup.c +++ b/sys/i386/isa/pcvt/pcvt_sup.c @@ -703,8 +703,11 @@ set_screen_size(struct video_state *svsp, int size) svsp->scrr_len = svsp->screen_rows; svsp->scrr_end = svsp->scrr_len - 1; - if (svsp->vs_tty && svsp->vs_tty->t_pgrp) + if (svsp->vs_tty && svsp->vs_tty->t_pgrp) { + PGRP_LOCK(svsp->vs_tty->t_pgrp); pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1); + PGRP_UNLOCK(svsp->vs_tty->t_pgrp); + } reallocate_scrollbuffer(svsp, svsp->scrollback_pages); break; |