$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [Boost.Thread] thread started after constructor
From: gast128 (gast128_at_[hidden])
Date: 2011-10-20 10:57:54
Hello all,
I have a basic question about threads: can one assume that the thread is started
after the constructor call (or when using create_thread in thread groups) or
does one has to use an extra synchronization primitive (e.g. a barrier)?
Example (real world is more complex):
void g(int* x)
{
int x1 = *x;
}
void f()
{
int x = 0;
boost::thread thd(&g, &x);
//<-- thread is started or not?
}