Skip to contentSkip to conversation

Known toolchain bug?

DISCUSSION Wolfgang Denk 1 participant 1 message Feb 16, 2014

lore
Share & tools
lore
#0 lore raw

Dear Gary Thomas,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 7 lines

in message [1] on the Linaro mailing list, Koen Kooi reported a toolchain problem. I can reproduce the same problem both in Yocto 1.5.1 and witht he current top-of-tree; for example, using the latest autobuilder result core-image-sato-sdk-imx53qsb-20140213124023.rootfs.tar.bz2 I get this [source of Koen's test program attached]:

Source code attachment missing?

Sorry. Here it is...

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Is the glass half empty, half full, or twice as large as it needs to

#include <iostream>
#include <thread>
#include <mutex>

std::mutex mx;
int i;

void thrfunc();

int main(void)
{
i=0;
std::thread thr1(thrfunc),thr2(thrfunc);

   thr1.join();
   thr2.join();

return 0;
}

void thrfunc()
{
mx.lock();
i++;
std::cout << std::this_thread::get_id() << " i: " << i << std::endl; mx.unlock();
}