Compartir vía


funciones<thread>

get_id

Identifica de forma única el subproceso de ejecución actual.

thread::id this_thread::get_id() noexcept;

Valor devuelto

Un objeto de tipo thread::id que identifica de forma única el subproceso de ejecución actual.

sleep_for

Bloquea el subproceso de llamada.

template <class Rep,
class Period>
inline void sleep_for(const chrono::duration<Rep, Period>& Rel_time);

Parámetros

Rel_time
Un objeto duration que especifica un intervalo de tiempo.

Comentarios

La función bloquea el subproceso de llamada al menos durante el tiempo especificado por Rel_time. Esta función no produce ninguna excepción.

sleep_until

Bloquea el subproceso de llamada al menos hasta la hora especificada.

template <class Clock, class Duration>
void sleep_until(const chrono::time_point<Clock, Duration>& Abs_time);

void sleep_until(const xtime *Abs_time);

Parámetros

Abs_time
Representa un punto en el tiempo.

Comentarios

Esta función no produce ninguna excepción.

swap

Intercambia los estados de dos objetos thread.

void swap(thread& Left, thread& Right) noexcept;

Parámetros

Left
Objeto thread izquierdo.

Right
Objeto thread derecho.

Comentarios

La función llama a Left.swap(Right).

yield

Indica al sistema operativo que ejecute otros subprocesos, incluso si el subproceso actual seguiría ejecutándose en condiciones normales.

inline void yield() noexcept;

Consulte también

<thread>