- Update test-python_loader, do not link to libpyloader anymore
- TODO: sigsegv (due to an hidden vtable?) git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@519 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
3c75e1391d
commit
ef733b37e8
13 changed files with 87 additions and 24 deletions
|
@ -41,7 +41,7 @@ namespace sgpem
|
|||
class SG_DLLEXPORT ObservedSubject
|
||||
{
|
||||
public:
|
||||
virtual ~ObservedSubject() =0;
|
||||
virtual ~ObservedSubject() = 0;
|
||||
|
||||
/**
|
||||
This method calls Update() on each attached Observer. It should be called when the internal state
|
||||
|
|
|
@ -173,6 +173,12 @@ PythonPolicy::wait_unlock() const throw(UserInterruptException)
|
|||
|
||||
if(i++ > 120)
|
||||
{
|
||||
|
||||
PyThreadState_Clear(_save);
|
||||
PyEval_RestoreThread(_save);
|
||||
|
||||
//Py_UNBLOCK_THREADS;
|
||||
|
||||
throw UserInterruptException("User-defined policy is "
|
||||
"taking too long to terminate.");
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ Scheduler::get_policy()
|
|||
|
||||
|
||||
void
|
||||
Scheduler::step_forward()
|
||||
Scheduler::step_forward() throw(UserInterruptException)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -196,11 +196,13 @@ Scheduler::step_forward()
|
|||
}
|
||||
catch( UserInterruptException e )
|
||||
{
|
||||
// FIXME : Naive.
|
||||
cerr << "Exception: " << e.what() << endl;
|
||||
|
||||
// Errrrr.... you won't like this:
|
||||
_policy_manager.init();
|
||||
|
||||
throw;
|
||||
|
||||
//TODO Do we need to perform some cleanup operation here?
|
||||
// Do we need to update something?
|
||||
|
||||
// https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1165761&group_id=5470
|
||||
// maybe it's that??? oh, damn.
|
||||
// or maybe not. see http://www.python.org/doc/2.4.2/api/initialization.html
|
||||
|
@ -210,3 +212,4 @@ Scheduler::step_forward()
|
|||
// - SimulationController that everything stopped
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace sgpem
|
|||
#include "observed_subject.hh"
|
||||
#include "history.hh"
|
||||
#include "schedulable_list.hh"
|
||||
#include "user_interrupt_exception.hh"
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
|
@ -96,7 +97,7 @@ namespace sgpem
|
|||
at the simulation instant next to the current one, and extends the History by
|
||||
one instant with it.
|
||||
*/
|
||||
void step_forward();
|
||||
void step_forward() throw(UserInterruptException);
|
||||
/**
|
||||
Sets the policy that will be used to generate the simulation at the next instant.
|
||||
\param policy the policy that will be used to generate the simulation at the next instant.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue