- Only schedule Threads. Ditch support for Policies deciding

if they want to schedule Threads or Processes altogether
- Move setter methods for last_acquisition/last_release from
DynamicSchedulable to DynamicThread
- Rewrite aforesaid methods, along with the respective getter
methods, into Dynamic(Thread|Process)


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@708 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-07-04 10:46:15 +00:00
parent 736aa25456
commit a378239d60
17 changed files with 119 additions and 194 deletions

View file

@ -160,27 +160,6 @@ PythonPolicy::get_time_slice() const throw(UserInterruptException)
return tmp < 0 ? numeric_limits<int>::max() : static_cast<int>(tmp);
}
policy_sorts_type
PythonPolicy::wants() const throw(UserInterruptException)
{
PyObject* retval = PyObject_CallMethod(_adapter, "async_wants", NULL);
Py_DECREF(retval);
wait_unlock();
// Parse return value stored in global Python object
retval = PyObject_CallMethod(_adapter, "get_return_value", NULL);
assert(retval);
long tmp = PyInt_AsLong(retval);
Py_DECREF(retval);
//FIXME add the MalformedPolicyException class and throw it the else
// branch instead
if(tmp == policy_sorts_threads || tmp == policy_sorts_processes)
return static_cast<policy_sorts_type>(tmp);
else
return policy_sorts_processes;
}
void
PythonPolicy::wait_unlock() const throw(UserInterruptException)