Update.
* manual/job.texi: Fix typos. * manual/process.texi: Likewise. * manual/signal.texi: Likewise.
This commit is contained in:
parent
7c437eb803
commit
a496e4ce95
@ -1,5 +1,9 @@
|
|||||||
2000-02-14 Ulrich Drepper <drepper@redhat.com>
|
2000-02-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* manual/job.texi: Fix typos.
|
||||||
|
* manual/process.texi: Likewise.
|
||||||
|
* manual/signal.texi: Likewise.
|
||||||
|
|
||||||
* sysdeps/powerpc/atomicity.h: Remove white space to avoid
|
* sysdeps/powerpc/atomicity.h: Remove white space to avoid
|
||||||
compiler warning.
|
compiler warning.
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
#include "restart.h"
|
#include "restart.h"
|
||||||
|
|
||||||
static int pthread_cond_timedwait_relative_old(pthread_cond_t *,
|
static int pthread_cond_timedwait_relative_old(pthread_cond_t *,
|
||||||
pthread_mutex_t *, struct timespec *);
|
pthread_mutex_t *, const struct timespec *);
|
||||||
|
|
||||||
static int pthread_cond_timedwait_relative_new(pthread_cond_t *,
|
static int pthread_cond_timedwait_relative_new(pthread_cond_t *,
|
||||||
pthread_mutex_t *, struct timespec *);
|
pthread_mutex_t *, const struct timespec *);
|
||||||
|
|
||||||
static int (*pthread_cond_tw_rel)(pthread_cond_t *, pthread_mutex_t *,
|
static int (*pthread_cond_tw_rel)(pthread_cond_t *, pthread_mutex_t *,
|
||||||
struct timespec *) = pthread_cond_timedwait_relative_old;
|
const struct timespec *) = pthread_cond_timedwait_relative_old;
|
||||||
|
|
||||||
/* initialize this module */
|
/* initialize this module */
|
||||||
void __pthread_init_condvar(int rt_sig_available)
|
void __pthread_init_condvar(int rt_sig_available)
|
||||||
@ -130,29 +130,15 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
|||||||
static int
|
static int
|
||||||
pthread_cond_timedwait_relative_old(pthread_cond_t *cond,
|
pthread_cond_timedwait_relative_old(pthread_cond_t *cond,
|
||||||
pthread_mutex_t *mutex,
|
pthread_mutex_t *mutex,
|
||||||
struct timespec * reltime)
|
const struct timespec * abstime)
|
||||||
{
|
{
|
||||||
volatile pthread_descr self = thread_self();
|
volatile pthread_descr self = thread_self();
|
||||||
sigset_t unblock, initial_mask;
|
sigset_t unblock, initial_mask;
|
||||||
#ifdef NANOSLEEP_WORKS
|
|
||||||
int already_canceled = 0;
|
int already_canceled = 0;
|
||||||
int was_signalled = 0;
|
int was_signalled = 0;
|
||||||
#else
|
|
||||||
int retsleep;
|
|
||||||
int already_canceled;
|
|
||||||
int was_signalled;
|
|
||||||
#endif
|
|
||||||
sigjmp_buf jmpbuf;
|
sigjmp_buf jmpbuf;
|
||||||
pthread_extricate_if extr;
|
pthread_extricate_if extr;
|
||||||
|
|
||||||
#ifndef NANOSLEEP_WORKS
|
|
||||||
requeue_and_wait_again:
|
|
||||||
|
|
||||||
retsleep = 0;
|
|
||||||
already_canceled = 0;
|
|
||||||
was_signalled = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set up extrication interface */
|
/* Set up extrication interface */
|
||||||
extr.pu_object = cond;
|
extr.pu_object = cond;
|
||||||
extr.pu_extricate_func = cond_extricate_func;
|
extr.pu_extricate_func = cond_extricate_func;
|
||||||
@ -187,22 +173,30 @@ pthread_cond_timedwait_relative_old(pthread_cond_t *cond,
|
|||||||
sigemptyset(&unblock);
|
sigemptyset(&unblock);
|
||||||
sigaddset(&unblock, __pthread_sig_restart);
|
sigaddset(&unblock, __pthread_sig_restart);
|
||||||
sigprocmask(SIG_UNBLOCK, &unblock, &initial_mask);
|
sigprocmask(SIG_UNBLOCK, &unblock, &initial_mask);
|
||||||
#ifdef NANOSLEEP_WORKS
|
|
||||||
/* Sleep for the required duration. If woken by a signal, resume waiting
|
while (1) {
|
||||||
as required by Single Unix Specification. */
|
struct timeval now;
|
||||||
while (__libc_nanosleep(reltime, reltime) != 0)
|
struct timespec reltime;
|
||||||
;
|
|
||||||
#else
|
/* Compute a time offset relative to now. */
|
||||||
/* Sleep for the required duration */
|
__gettimeofday (&now, NULL);
|
||||||
retsleep = __libc_nanosleep(reltime, NULL);
|
reltime.tv_nsec = abstime->tv_nsec - now.tv_usec * 1000;
|
||||||
#endif
|
reltime.tv_sec = abstime->tv_sec - now.tv_sec;
|
||||||
|
if (reltime.tv_nsec < 0) {
|
||||||
|
reltime.tv_nsec += 1000000000;
|
||||||
|
reltime.tv_sec -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sleep for the required duration. If woken by a signal,
|
||||||
|
resume waiting as required by Single Unix Specification. */
|
||||||
|
if (reltime.tv_sec < 0 || __libc_nanosleep(&reltime, NULL) == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Block the restart signal again */
|
/* Block the restart signal again */
|
||||||
sigprocmask(SIG_SETMASK, &initial_mask, NULL);
|
sigprocmask(SIG_SETMASK, &initial_mask, NULL);
|
||||||
was_signalled = 0;
|
was_signalled = 0;
|
||||||
} else {
|
} else {
|
||||||
#ifndef NANOSLEEP_WORKS
|
|
||||||
retsleep = -1;
|
|
||||||
#endif
|
|
||||||
was_signalled = 1;
|
was_signalled = 1;
|
||||||
}
|
}
|
||||||
THREAD_SETMEM(self, p_signal_jmp, NULL);
|
THREAD_SETMEM(self, p_signal_jmp, NULL);
|
||||||
@ -234,15 +228,7 @@ pthread_cond_timedwait_relative_old(pthread_cond_t *cond,
|
|||||||
if (was_on_queue) {
|
if (was_on_queue) {
|
||||||
__pthread_set_own_extricate_if(self, 0);
|
__pthread_set_own_extricate_if(self, 0);
|
||||||
pthread_mutex_lock(mutex);
|
pthread_mutex_lock(mutex);
|
||||||
#ifdef NANOSLEEP_WORKS
|
|
||||||
return ETIMEDOUT;
|
return ETIMEDOUT;
|
||||||
#else
|
|
||||||
if (retsleep == 0)
|
|
||||||
return ETIMEDOUT;
|
|
||||||
/* Woken by a signal: resume waiting as required by Single Unix
|
|
||||||
Specification. */
|
|
||||||
goto requeue_and_wait_again;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend(self);
|
suspend(self);
|
||||||
@ -275,28 +261,14 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
|
|||||||
{
|
{
|
||||||
volatile pthread_descr self = thread_self();
|
volatile pthread_descr self = thread_self();
|
||||||
sigset_t unblock, initial_mask;
|
sigset_t unblock, initial_mask;
|
||||||
#ifdef NANOSLEEP_WORKS
|
|
||||||
int already_canceled = 0;
|
int already_canceled = 0;
|
||||||
int was_signalled = 0;
|
int was_signalled = 0;
|
||||||
#else
|
|
||||||
int retsleep;
|
|
||||||
int already_canceled;
|
|
||||||
int was_signalled;
|
|
||||||
#endif
|
|
||||||
sigjmp_buf jmpbuf;
|
sigjmp_buf jmpbuf;
|
||||||
pthread_extricate_if extr;
|
pthread_extricate_if extr;
|
||||||
|
|
||||||
already_canceled = 0;
|
already_canceled = 0;
|
||||||
was_signalled = 0;
|
was_signalled = 0;
|
||||||
|
|
||||||
#ifndef NANOSLEEP_WORKS
|
|
||||||
requeue_and_wait_again:
|
|
||||||
|
|
||||||
retsleep = 0;
|
|
||||||
already_canceled = 0;
|
|
||||||
was_signalled = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set up extrication interface */
|
/* Set up extrication interface */
|
||||||
extr.pu_object = cond;
|
extr.pu_object = cond;
|
||||||
extr.pu_extricate_func = cond_extricate_func;
|
extr.pu_extricate_func = cond_extricate_func;
|
||||||
@ -330,22 +302,30 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
|
|||||||
sigemptyset(&unblock);
|
sigemptyset(&unblock);
|
||||||
sigaddset(&unblock, __pthread_sig_restart);
|
sigaddset(&unblock, __pthread_sig_restart);
|
||||||
sigprocmask(SIG_UNBLOCK, &unblock, &initial_mask);
|
sigprocmask(SIG_UNBLOCK, &unblock, &initial_mask);
|
||||||
#ifdef NANOSLEEP_WORKS
|
|
||||||
/* Sleep for the required duration. If woken by a signal, resume waiting
|
while (1) {
|
||||||
as required by Single Unix Specification. */
|
struct timeval now;
|
||||||
while (__libc_nanosleep(reltime, reltime) != 0)
|
struct timespec reltime;
|
||||||
;
|
|
||||||
#else
|
/* Compute a time offset relative to now. */
|
||||||
/* Sleep for the required duration */
|
__gettimeofday (&now, NULL);
|
||||||
retsleep = __libc_nanosleep(reltime, NULL);
|
reltime.tv_nsec = abstime->tv_nsec - now.tv_usec * 1000;
|
||||||
#endif
|
reltime.tv_sec = abstime->tv_sec - now.tv_sec;
|
||||||
|
if (reltime.tv_nsec < 0) {
|
||||||
|
reltime.tv_nsec += 1000000000;
|
||||||
|
reltime.tv_sec -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sleep for the required duration. If woken by a signal,
|
||||||
|
resume waiting as required by Single Unix Specification. */
|
||||||
|
if (reltime.tv_sec < 0 || __libc_nanosleep(&reltime, NULL) == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Block the restart signal again */
|
/* Block the restart signal again */
|
||||||
sigprocmask(SIG_SETMASK, &initial_mask, NULL);
|
sigprocmask(SIG_SETMASK, &initial_mask, NULL);
|
||||||
was_signalled = 0;
|
was_signalled = 0;
|
||||||
} else {
|
} else {
|
||||||
#ifndef NANOSLEEP_WORKS
|
|
||||||
retsleep = -1;
|
|
||||||
#endif
|
|
||||||
was_signalled = 1;
|
was_signalled = 1;
|
||||||
}
|
}
|
||||||
THREAD_SETMEM(self, p_signal_jmp, NULL);
|
THREAD_SETMEM(self, p_signal_jmp, NULL);
|
||||||
@ -374,15 +354,7 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
|
|||||||
if (was_on_queue) {
|
if (was_on_queue) {
|
||||||
__pthread_set_own_extricate_if(self, 0);
|
__pthread_set_own_extricate_if(self, 0);
|
||||||
pthread_mutex_lock(mutex);
|
pthread_mutex_lock(mutex);
|
||||||
#ifdef NANOSLEEP_WORKS
|
|
||||||
return ETIMEDOUT;
|
return ETIMEDOUT;
|
||||||
#else
|
|
||||||
if (retsleep == 0)
|
|
||||||
return ETIMEDOUT;
|
|
||||||
/* Woken by a signal: resume waiting as required by Single Unix
|
|
||||||
Specification. */
|
|
||||||
goto requeue_and_wait_again;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Eat the outstanding restart() from the signaller */
|
/* Eat the outstanding restart() from the signaller */
|
||||||
@ -408,22 +380,8 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
|
|||||||
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||||
const struct timespec * abstime)
|
const struct timespec * abstime)
|
||||||
{
|
{
|
||||||
struct timeval now;
|
|
||||||
struct timespec reltime;
|
|
||||||
|
|
||||||
/* Compute a time offset relative to now. */
|
|
||||||
__gettimeofday (&now, NULL);
|
|
||||||
reltime.tv_nsec = abstime->tv_nsec - now.tv_usec * 1000;
|
|
||||||
reltime.tv_sec = abstime->tv_sec - now.tv_sec;
|
|
||||||
if (reltime.tv_nsec < 0) {
|
|
||||||
reltime.tv_nsec += 1000000000;
|
|
||||||
reltime.tv_sec -= 1;
|
|
||||||
}
|
|
||||||
if (reltime.tv_sec < 0)
|
|
||||||
return ETIMEDOUT;
|
|
||||||
|
|
||||||
/* Indirect call through pointer! */
|
/* Indirect call through pointer! */
|
||||||
return pthread_cond_tw_rel(cond, mutex, &reltime);
|
return pthread_cond_tw_rel(cond, mutex, abstime);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pthread_cond_signal(pthread_cond_t *cond)
|
int pthread_cond_signal(pthread_cond_t *cond)
|
||||||
|
@ -675,8 +675,8 @@ stop together.
|
|||||||
|
|
||||||
The foreground job may have left the terminal in a strange state, so the
|
The foreground job may have left the terminal in a strange state, so the
|
||||||
shell should restore its own saved terminal modes before continuing. In
|
shell should restore its own saved terminal modes before continuing. In
|
||||||
case the job is merely been stopped, the shell should first save the
|
case the job is merely stopped, the shell should first save the current
|
||||||
current terminal modes so that it can restore them later if the job is
|
terminal modes so that it can restore them later if the job is
|
||||||
continued. The functions for dealing with terminal modes are
|
continued. The functions for dealing with terminal modes are
|
||||||
@code{tcgetattr} and @code{tcsetattr}; these are described in
|
@code{tcgetattr} and @code{tcsetattr}; these are described in
|
||||||
@ref{Terminal Modes}.
|
@ref{Terminal Modes}.
|
||||||
|
@ -63,7 +63,7 @@ possible to create the shell process, and otherwise is the status of the
|
|||||||
shell process. @xref{Process Completion}, for details on how this
|
shell process. @xref{Process Completion}, for details on how this
|
||||||
status code can be interpreted.
|
status code can be interpreted.
|
||||||
|
|
||||||
If the @var{command} argument is a null pointer a non-zero return value
|
If the @var{command} argument is a null pointer, a non-zero return value
|
||||||
indicates that a command processor is available and this function can be
|
indicates that a command processor is available and this function can be
|
||||||
used at all.
|
used at all.
|
||||||
|
|
||||||
|
@ -543,7 +543,7 @@ In fact, if @code{SIGKILL} fails to terminate a process, that by itself
|
|||||||
constitutes an operating system bug which you should report.
|
constitutes an operating system bug which you should report.
|
||||||
|
|
||||||
The system will generate @code{SIGKILL} for a process itself under some
|
The system will generate @code{SIGKILL} for a process itself under some
|
||||||
unusual conditions where the program cannot possible continue to run
|
unusual conditions where the program cannot possibly continue to run
|
||||||
(even to run a signal handler).
|
(even to run a signal handler).
|
||||||
@end deftypevr
|
@end deftypevr
|
||||||
@cindex kill signal
|
@cindex kill signal
|
||||||
@ -3011,7 +3011,7 @@ to terminate the process or invoke a signal handling function. In other
|
|||||||
words, the program is effectively suspended until one of the signals that
|
words, the program is effectively suspended until one of the signals that
|
||||||
is not a member of @var{set} arrives.
|
is not a member of @var{set} arrives.
|
||||||
|
|
||||||
If the process is woken up by deliver of a signal that invokes a handler
|
If the process is woken up by delivery of a signal that invokes a handler
|
||||||
function, and the handler function returns, then @code{sigsuspend} also
|
function, and the handler function returns, then @code{sigsuspend} also
|
||||||
returns.
|
returns.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user