* thread.h (__reent_t::init_clib): Declare new function.
* thread.cc (__reent_t::init_clib): Define new function. (pthread::thread_init_wrapper): Use __reent_t::init_clib to init local clib storage and set std{in,out,err} appropriately.
This commit is contained in:
parent
bc54734d15
commit
370b1173b0
|
@ -1,3 +1,10 @@
|
|||
2003-09-19 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* thread.h (__reent_t::init_clib): Declare new function.
|
||||
* thread.cc (__reent_t::init_clib): Define new function.
|
||||
(pthread::thread_init_wrapper): Use __reent_t::init_clib to init local
|
||||
clib storage and set std{in,out,err} appropriately.
|
||||
|
||||
2003-09-19 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* syscalls.cc (system): Strip signal considerations from here so that
|
||||
|
|
|
@ -1769,6 +1769,16 @@ verifyable_object_isvalid (void const * objectptr, long magic)
|
|||
return verifyable_object_isvalid (objectptr, magic, NULL);
|
||||
}
|
||||
|
||||
inline void
|
||||
__reent_t::init_clib (struct _reent& var)
|
||||
{
|
||||
var = ((struct _reent) _REENT_INIT (var));
|
||||
var._stdin = _GLOBAL_REENT->_stdin;
|
||||
var._stdout = _GLOBAL_REENT->_stdout;
|
||||
var._stderr = _GLOBAL_REENT->_stderr;
|
||||
_clib = &var;
|
||||
};
|
||||
|
||||
/* Pthreads */
|
||||
void *
|
||||
pthread::thread_init_wrapper (void *_arg)
|
||||
|
@ -1778,7 +1788,7 @@ pthread::thread_init_wrapper (void *_arg)
|
|||
pthread *thread = (pthread *) _arg;
|
||||
struct __reent_t local_reent;
|
||||
struct _winsup_t local_winsup;
|
||||
struct _reent local_clib = _REENT_INIT (local_clib);
|
||||
struct _reent local_clib;
|
||||
|
||||
struct sigaction _sigs[NSIG];
|
||||
sigset_t _sig_mask; /* one set for everything to ignore. */
|
||||
|
@ -1791,7 +1801,7 @@ pthread::thread_init_wrapper (void *_arg)
|
|||
|
||||
memset (&local_winsup, 0, sizeof (struct _winsup_t));
|
||||
|
||||
local_reent._clib = &local_clib;
|
||||
local_reent.init_clib (local_clib);
|
||||
local_reent._winsup = &local_winsup;
|
||||
|
||||
local_winsup._process_logmask = LOG_UPTO (LOG_DEBUG);
|
||||
|
|
|
@ -108,6 +108,7 @@ struct __reent_t
|
|||
{
|
||||
struct _reent *_clib;
|
||||
struct _winsup_t *_winsup;
|
||||
void init_clib (_reent&);
|
||||
};
|
||||
|
||||
_winsup_t *_reent_winsup ();
|
||||
|
|
Loading…
Reference in New Issue