Namensräume
Varianten
Aktionen

cnd_timedwait

Aus cppreference.com
< c‎ | thread

 
 
Thema Support-Bibliothek
Threads
Original:
Threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Gegenseitigen Ausschluss
Original:
Mutual exclusion
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Rufen Sie einmal
Original:
Call once
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Zustand Variablen
Original:
Condition variables
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cnd_wait
cnd_timedwait
cnd_destroy
Thread-lokalen Speicher
Original:
Thread-local storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Defined in header <threads.h>
int cnd_timedwait( cnd_t* restrict cond, mtx_t* restrict mutex,
                   const struct timespec* restrict time_point );
(Seit C11)
Atomar sperrt der Mutex, auf den durch mutex und blockiert unter der Bedingung, auf die variablen cond bis der Faden durch cnd_signal oder cnd_broadcast oder bis der TIME_UTC basierenden Zeitpunkt, auf den durch time_point erreicht signalisiert wird. Der Mutex wieder bevor die Funktion zurückkehrt gesperrt .
Original:
Atomically locks the mutex pointed to by mutex and blocks on the condition variable pointed to by cond until the thread is signalled by cnd_signal or cnd_broadcast, or until the TIME_UTC based time point pointed to by time_point has been reached. The mutex is locked again before the function returns.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Das Verhalten ist undefiniert, wenn der Mutex nicht bereits durch den aufrufenden Thread gesperrt .
Original:
The behavior is undefined if the mutex is not already locked by the calling thread.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Parameter

cond -
Zeiger auf die Zustandsgröße auf blockieren
Original:
pointer to the condition variable to block on
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mutex -
Zeiger auf den Mutex, um für die Dauer des Blocks zu entsperren
Original:
pointer to the mutex to unlock for the duration of the block
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
duration -
Zeiger auf ein Objekt angeben Timeout-Zeit zu warten, bis
Original:
pointer to a object specifying timeout time to wait until
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Rückgabewert

thrd_success wenn erfolgreich, thrd_timedout wenn die Timeout-Zeit erreicht wurde, bevor die Mutex gesperrt ist, oder thrd_error wenn ein Fehler aufgetreten .
Original:
thrd_success if successful, thrd_timedout if the timeout time has been reached before the mutex is locked, or thrd_error if an error occurred.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Siehe auch

Blöcke auf einer Zustandsgröße
Original:
blocks on a condition variable
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Funktion) [edit]