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