* sync.h (new_muto): Just accept an argument which denotes the name of the
muto. Use this argument to construct static storage. * cygheap.cc (cygheap_init): Reflect above change. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * cygheap.h (cwdstuff): Change name of lock element to make it less generic. * path.cc (cwdstuff::get_hash): Ditto. (cwdstuff::get_initial): Ditto. (cwdstuff::set): Ditto. (cwdstuff::get): Ditto. * sigproc.cc (proc_subproc): Ditto. * debug.cc (lock_debug): Change to method. Use method rather than macro throughout. * tty.h (tty_min::kill_pgrp): Declare new method. * fhandler_termios.cc (tty_min::kill_pgrp): New method. (fhandler_termios::line_edit): Use new method for killing process. * dcrt0.cc (do_exit): Ditto. * dtable.cc (dtable::get_debugger_info): New method for inheriting dtable info from a debugger. * tty.cc (tty_init): Attempt to grab file handle info from parent debugger, if appropriate. # dtable.cc (dtable::stdio_init): Make this a method. (dtable::init_std_file_from_handle): Don't set fd unless it's not open. (dtable::build_fhandler_from_name): Move name setting to dtable::build_fhandler. (dtable::build_fhandler): Add win32 name parameter. * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init. * dtable.h (dtable): Reflect build_fhandler parameter change. * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in build_fhandler. * net.cc (fdsock): Remove set_name call since it is now handled by build_fhandler. * sigproc.cc (proc_subproc): Release muto as early as possible.
This commit is contained in:
@ -3536,9 +3536,9 @@ DWORD
|
||||
cwdstuff::get_hash ()
|
||||
{
|
||||
DWORD hashnow;
|
||||
lock->acquire ();
|
||||
cwd_lock->acquire ();
|
||||
hashnow = hash;
|
||||
lock->release ();
|
||||
cwd_lock->release ();
|
||||
return hashnow;
|
||||
}
|
||||
|
||||
@ -3546,7 +3546,7 @@ cwdstuff::get_hash ()
|
||||
void
|
||||
cwdstuff::init ()
|
||||
{
|
||||
lock = new_muto ("cwd");
|
||||
new_muto (cwd_lock);
|
||||
}
|
||||
|
||||
/* Get initial cwd. Should only be called once in a
|
||||
@ -3554,7 +3554,7 @@ cwdstuff::init ()
|
||||
bool
|
||||
cwdstuff::get_initial ()
|
||||
{
|
||||
lock->acquire ();
|
||||
cwd_lock->acquire ();
|
||||
|
||||
if (win32)
|
||||
return 1;
|
||||
@ -3571,9 +3571,9 @@ cwdstuff::get_initial ()
|
||||
if (len == 0)
|
||||
{
|
||||
__seterrno ();
|
||||
lock->release ();
|
||||
cwd_lock->release ();
|
||||
debug_printf ("get_initial_cwd failed, %E");
|
||||
lock->release ();
|
||||
cwd_lock->release ();
|
||||
return 0;
|
||||
}
|
||||
set (NULL);
|
||||
@ -3590,7 +3590,7 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd)
|
||||
|
||||
if (win32_cwd)
|
||||
{
|
||||
lock->acquire ();
|
||||
cwd_lock->acquire ();
|
||||
win32 = (char *) crealloc (win32, strlen (win32_cwd) + 1);
|
||||
strcpy (win32, win32_cwd);
|
||||
}
|
||||
@ -3606,7 +3606,7 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd)
|
||||
hash = hash_path_name (0, win32);
|
||||
|
||||
if (win32_cwd)
|
||||
lock->release ();
|
||||
cwd_lock->release ();
|
||||
|
||||
return;
|
||||
}
|
||||
@ -3651,7 +3651,7 @@ cwdstuff::get (char *buf, int need_posix, int with_chroot, unsigned ulen)
|
||||
strcpy (buf, "/");
|
||||
}
|
||||
|
||||
lock->release ();
|
||||
cwd_lock->release ();
|
||||
|
||||
out:
|
||||
syscall_printf ("(%s) = cwdstuff::get (%p, %d, %d, %d), errno %d",
|
||||
|
Reference in New Issue
Block a user