2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13 #ifndef __RUNNER_HXX__
14 #define __RUNNER_HXX__
18 #include "execvisitor.hxx"
22 #include "Thread_Wrapper.h"
23 #include "dynlib_core.h"
25 __threadSignal* getAstPendingSignal();
28 #include "threadId.hxx"
31 class CORE_IMPEXP Runner
34 Runner(ast::Exp* _theProgram, ast::ExecVisitor *_visitor)
36 m_theProgram = _theProgram;
50 static void execAndWait(ast::Exp* _theProgram, ast::ExecVisitor *_visitor, bool _isPriorityThread);
52 void exec(ast::Exp* _theProgram, ast::ExecVisitor *_visitor);
54 ast::ExecVisitor *getVisitor()
59 ast::Exp* getProgram()
64 __threadId getThreadId(void)
69 void setThreadId(__threadId _threadId)
71 m_threadId = _threadId;
74 __threadKey getThreadKey(void)
79 static __threadSignal* getAstPendingSignal(void)
84 void setThreadKey(__threadKey _threadId)
86 m_threadKey = _threadId;
89 static void UnlockPrompt();
91 static void LockPrompt();
94 static void *launch(void *args);
97 __threadKey m_threadKey;
98 __threadId m_threadId;
99 ast::Exp* m_theProgram;
100 ast::ExecVisitor* m_visitor;
103 static __threadSignal m_awakeScilab;
104 static __threadSignalLock m_awakeScilabLock;
105 static __threadLock m_lock;
106 static __threadLock m_PrioritaryLock;
107 static __threadSignal m_AstPending;
108 static __threadSignalLock m_AstPendingLock;
110 #endif /* !__RUNNER_HXX__ */