| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-fgnu-tm" } |
| 3 |
// { dg-skip-if "requires hosted libstdc++ for list" { ! hostedlib } } |
| 4 |
|
| 5 |
#include <list> |
| 6 |
class Game |
| 7 |
{ |
| 8 |
public: |
| 9 |
struct BuildProject |
| 10 |
{ |
| 11 |
int posX; |
| 12 |
}; |
| 13 |
std::list<BuildProject> buildProjects; |
| 14 |
}; |
| 15 |
|
| 16 |
static Game game; |
| 17 |
static std::list<std::list<Game::BuildProject>::iterator> erasableBuildProjects; |
| 18 |
|
| 19 |
static void *buildProjectSyncStepConcurrently(int id, int localTeam) |
| 20 |
{ |
| 21 |
__transaction_relaxed { |
| 22 |
std::list<std::list<Game::BuildProject>::iterator>::iterator it |
| 23 |
= erasableBuildProjects.begin(); |
| 24 |
game.buildProjects.erase( (std::list<Game::BuildProject> |
| 25 |
::iterator) *it); |
| 26 |
} |
| 27 |
return 0; |
| 28 |
} |