/
stmlog.pmc
50 lines (36 loc) · 1003 Bytes
/
stmlog.pmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
Copyright (C) 2004, The Perl Foundation.
$Id$
=head1 NAME
src/pmc/stmlog.pmc -- Holds a transaction log that can be replayed
=head1 DESCRIPTION
This PMC class holds an STM transaction log that can be replayed.
Replaying is only guaranteed to be implemented enough to allow
choice (Haskell `orElse`) to be implemented.
This PMC will copy the current the transaction's log when it
is initialized.
=cut
*/
#include "parrot/parrot.h"
pmclass STMLog {
void init() {
PMC_struct_val(SELF) = Parrot_STM_extract(INTERP);
PObj_active_destroy_SET(SELF);
PObj_custom_mark_SET(SELF);
}
void destroy() {
Parrot_STM_destroy_extracted(INTERP, PMC_struct_val(SELF));
}
void mark() {
Parrot_STM_mark_extracted(INTERP, PMC_struct_val(SELF));
}
METHOD void replay() {
Parrot_STM_replay_extracted(INTERP, PMC_struct_val(SELF));
}
}
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4:
*/