* shared_info.h (open_shared): Create function wrapper for common use case.

(open_shared): Change fifth argument to a pointer rather than a reference.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Eliminate use of dummy
variable and call open_shared with constant.
* fhandler_process.cc (format_process_mounts): Ditto.
* pinfo.cc (pinfo::init): Pass pointer to shloc.
* shared.cc (shared_mem_inited): New variable.
(open_shared): Crate function wrapper for common use case.
(open_shared): Accommodate change to fifth argument to a pointer.
(shared_info::initialize): Remove spinlock test.  Simplify function.  Move
get_session_parent_dir call back here.
(memory_init): Protect global shared settings with shared_mem_inited spinlock.
Move get_session_parent_dir call to shared_info::initialize.
This commit is contained in:
Christopher Faylor
2010-03-09 21:26:55 +00:00
parent fab7d5988a
commit bd3b3783f8
6 changed files with 85 additions and 47 deletions

View File

@@ -83,11 +83,10 @@ fhandler_console::get_tty_stuff (int flags = 0)
if (dev_state)
return &shared_console_info->tty_min_state;
shared_locations sh_shared_console = SH_SHARED_CONSOLE;
shared_console_info =
(console_state *) open_shared (NULL, 0, cygheap->console_h,
sizeof (*shared_console_info),
sh_shared_console);
SH_SHARED_CONSOLE);
dev_state = &shared_console_info->dev_state;
ProtectHandleINH (cygheap->console_h);