Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/thr_suspend.3c
Real path: /usr/share/man/man3c/thr_suspend.3c
Zurück
'\" te .\" Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. .TH thr_suspend 3C "14 May 2018" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME thr_suspend, thr_continue \- suspend or continue thread execution .SH SYNOPSIS .LP .nf #include <thread.h> \fBint\fR \fBthr_suspend\fR(\fBthread_t\fR \fItarget_thread\fR); .fi .LP .nf \fBint\fR \fBthr_continue\fR(\fBthread_t\fR \fItarget_thread\fR); .fi .SH DESCRIPTION .sp .LP The \fBthr_suspend()\fR function immediately suspends the execution of the thread specified by \fItarget_thread\fR. On successful return from \fBthr_suspend()\fR, the suspended thread is no longer executing. Once a thread is suspended, subsequent calls to \fBthr_suspend()\fR have no effect. .sp .LP The \fBthr_continue()\fR function resumes the execution of a suspended thread. Once a suspended thread is continued, subsequent calls to \fBthr_continue()\fR have no effect. .sp .LP A suspended thread will not be awakened by any mechanism other than a call to \fBthr_continue()\fR. Signals and the effect of calls to \fBmutex_unlock\fR(3C), \fBrw_unlock\fR(3C), \fBsema_post\fR(3C), \fBcond_signal\fR(3C), and \fBcond_broadcast\fR(3C) remain pending until the execution of the thread is resumed by \fBthr_continue()\fR. .SH RETURN VALUES .sp .LP If successful, the \fBthr_suspend()\fR and \fBthr_continue()\fR functions return \fB0\fR. Otherwise, a non-zero value is returned to indicate the error. It is not an error for the target thread to be a zombie thread. .SH ERRORS .sp .LP The \fBthr_suspend()\fR and \fBthr_continue()\fR functions will fail if: .sp .ne 2 .mk .na \fB\fBESRCH\fR\fR .ad .RS 9n .rt The \fItarget_thread\fR cannot be found in the current process. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level MT-Safe .TE .sp .SH SEE ALSO .sp .LP \fBthr_create\fR(3C), \fBthr_join\fR(3C), \fBattributes\fR(7), \fBstandards\fR(7) .SH WARNINGS .sp .LP The \fBthr_suspend()\fR function is extremely difficult to use safely because it suspends the target thread with no concern for the target thread's state. The target thread could be holding locks, waiting for a lock, or waiting on a condition variable when it is unconditionally suspended. The thread will not run until \fBthr_continue()\fR is applied, regardless of any calls to \fBmutex_unlock()\fR, \fBcond_signal()\fR, or \fBcond_broadcast()\fR by other threads. Its existence on a sleep queue can interfere with the waking up of other threads that are on the same sleep queue. .sp .LP The \fBthr_suspend()\fR and \fBthr_continue()\fR functions should be avoided. Mechanisms that involve the cooperation of the targeted thread, such as mutex locks and condition variables, should be employed instead.