Skip to content

Threads need to work as expected #1

Description

@walkero-gr

We need to make sure threads are working well on our system
There are two examples that can be used for testing it:

  1. https://en.cppreference.com/w/cpp/thread/call_once
  2. https://cplusplus.com/reference/condition_variable/condition_variable/

The second one seems to work fine with both clib2 and newlib.

The first one though is not working as expected.
It is expected to have the following output

Simple example: called once
throw: call_once will retry
throw: call_once will retry
Didn't throw, call_once will not attempt again

but it prints only the first two lines and then the CPU goes to 100% and remains like that

The way I compiled them:

ppc-amigaos-g++ -std=c++0x -pedantic -athread=native -o callonce_newlib callonce.cpp
ppc-amigaos-g++ -mcrt=clib2 -std=c++0x -pedantic -athread=native -o callonce_clib2 callonce.cpp

ppc-amigaos-g++ -std=c++0x -pedantic -athread=native -o conditionvariable_newlib conditionvariable.cpp
ppc-amigaos-g++ -mcrt=clib2 -std=c++0x -pedantic -athread=native -o conditionvariable_clib2 conditionvariable.cpp

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions