Skip to content

Addendum PR4988 - dead-lock in std.allocator.free_list unittest#4993

Merged
andralex merged 1 commit intodlang:masterfrom
WalterWaldron:fix16352
Dec 24, 2016
Merged

Addendum PR4988 - dead-lock in std.allocator.free_list unittest#4993
andralex merged 1 commit intodlang:masterfrom
WalterWaldron:fix16352

Conversation

@WalterWaldron
Copy link
Contributor

@WalterWaldron WalterWaldron commented Dec 24, 2016

https://issues.dlang.org/show_bug.cgi?id=16352

#4988 Fixed the cause, this allows the test to fail properly.

What was typically happening was

    private void decNodes() shared
    {
        assert(nodes);
        atomicOp!("-=")(nodes, 1);
    }

Would fail the assertion (because of data race.)
I don't know why scope(exit) tid.send(true); didn't allow the main thread to exit.

Anyway, instead I used ThreadGroup.joinAll to rethrow exceptions in the unit test thread.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
16352 dead-lock in std.allocator.free_list unittest

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

@andralex andralex merged commit ee68d84 into dlang:master Dec 24, 2016
@WalterWaldron WalterWaldron deleted the fix16352 branch December 26, 2016 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants