Std:: thread t(&thread function); // t starts running


Download 14.36 Kb.
Sana03.06.2020
Hajmi14.36 Kb.
#113963
Bog'liq
kod


#include

#include

void thread_function()

{

std::cout << "thread function\n";



}

int main()

{

std::thread t(&thread_function); // t starts running



std::cout << "main thread\n";

t.join(); // main thread waits for the thread t to finish



return 0;

}

Download 14.36 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling