2 Copyright (C) 2001-2007, Parrot Foundation.
7 src/pmc/threadinterpreter.pmc - INTERNAL Interpreter for OS level worker thread(pthread).
11 ThreadInterpreter extends ParrotInterpreter to provide a interpreter
12 to be used internally in a OS level worker thread(pthread).
23 #include "parrot/embed.h"
25 /* HEADERIZER HFILE: none */
26 /* HEADERIZER BEGIN: static */
27 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
29 static void stop_GC(ARGMOD(Interp *parent), ARGMOD(Interp *thread))
30 __attribute__nonnull__(1)
31 __attribute__nonnull__(2)
32 FUNC_MODIFIES(*parent)
33 FUNC_MODIFIES(*thread);
35 #define ASSERT_ARGS_stop_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
36 PARROT_ASSERT_ARG(parent) \
37 , PARROT_ASSERT_ARG(thread))
38 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
39 /* HEADERIZER END: static */
41 #define PMC_interp(x) ((Parrot_ParrotInterpreter_attributes *)PMC_data(x))->interp
44 * can't do multi-threaded GC yet
45 * XXX a quick hack to pass the few tests
50 =item C<static void stop_GC(Interp *parent, Interp *thread)>
57 stop_GC(ARGMOD(Interp *parent), ARGMOD(Interp *thread))
60 Parrot_block_GC_mark(parent);
61 Parrot_block_GC_mark(thread);
62 Parrot_block_GC_sweep(parent);
63 Parrot_block_GC_sweep(thread);
68 pmclass ThreadInterpreter extends ParrotInterpreter no_ro manual_attrs {
74 Initializes the thread.
81 /* protect interpreter creation and list handling */
82 LOCK(interpreter_array_mutex);
85 pt_add_to_interpreters(INTERP, PMC_interp(SELF));
87 UNLOCK(interpreter_array_mutex);
89 /* can't allow GC runs for now */
90 stop_GC(INTERP, PMC_interp(SELF));
104 * c-file-style: "parrot"
106 * vim: expandtab shiftwidth=4: