예제 #1
0
void other_function()
{
    atomic([](read_transaction tx) {
        if (x.get(tx) != 0)
            std::terminate();
    });
}
예제 #2
0
void run_other_file()
{
    other_function();
    atomic([](transaction tx) { y.set(tx, x.get(tx)); });
    atomic([](transaction tx) { w.set(tx, z.get(tx)); });
    atomic([](transaction tx) {
        if (x.untracked_get(tx) != 0)
            std::terminate();
    });
    atomic([](read_transaction tx) {
        if (x.get(tx) != 0)
            std::terminate();
    });
    atomic([](read_transaction tx) {
        if (x.untracked_get(tx) != 0)
            std::terminate();
    });
}
예제 #3
0
int main()
{
    run_other_file();
    atomic([](transaction tx) { x.set(tx, y.get(tx)); });
    atomic([](transaction tx) { z.set(tx, w.get(tx)); });
    atomic([](transaction tx) {
        if (x.untracked_get(tx) != 0)
            std::terminate();
    });
    atomic([](read_transaction tx) {
        if (x.get(tx) != 0)
            std::terminate();
    });
    atomic([](read_transaction tx) {
        if (x.untracked_get(tx) != 0)
            std::terminate();
    });

    return test_result();
}