<commit_before>#!./parrot-nqp

# Copyright (C) 2012, Parrot Foundation.

Q:PIR {
        # We want Test::More features for testing. Not NQP's builtin.
        .include "test_more.pir"
        load_bytecode "dumper.pbc"
};

plan(2);

my $x := 5;

my $sub := sub foo() {
    $x++;
    ok(1, 'sub sucessfully called from Task');
}

my $task := pir::new__PSP('Task', $sub);

ok(1, 'created a Task PMC from nqp');

pir::schedule__0P($task);
ok(1, 'scheduled a task');
pir::wait__0P($task);

ok(1,'wait on a task');

# Local Variables:
#   mode: nqp
#   fill-column: 100
# End:<commit_msg>[test] fix ext/nqp-rx/t/nqp/67-threads.t thread-safety<commit_after>#!./parrot-nqp

# Copyright (C) 2012, Parrot Foundation.

plan(4);

my $x := "ok 3 - sub sucessfully called from Task";
my $sub := sub foo() {
    say($x);
}

say("# Task ...");
my $task := pir::new__PSP('Task', $sub);

say("ok 1 - created a Task PMC from nqp");

pir::schedule__0P($task);
say("ok 2 - scheduled a task");
pir::wait__0P($task);

say("ok 4 - wait on a task");

# Local Variables:
#   mode: nqp
#   fill-column: 100
# End:
{'fraction_non_alphanumeric': 0.1922723091076357, 'fraction_numerical': 0.028518859245630176, 'mean_word_length': 3.533333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3076314', 'n_tokens_mistral': 463, 'n_tokens_neox': 430, 'n_words': 120}