- Added Policy::wants() and updated related code. Scheduler::get_ready_queue() still always returns a process queue...
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@615 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
e5b90a39ad
commit
1e75fe91f1
9 changed files with 81 additions and 4 deletions
|
@ -95,6 +95,19 @@ class ScriptAdapter :
|
|||
self._ret_val = self._policy.get_time_slice()
|
||||
self._g_mutex.unlock()
|
||||
|
||||
## @brief Asynchronously call Policy.wants()
|
||||
#
|
||||
# @param self The caller object
|
||||
def async_wants(self):
|
||||
self._g_mutex.lock(ScriptAdapter._wrap_wants, self)
|
||||
|
||||
def _wrap_wants(self):
|
||||
thread.start_new_thread(ScriptAdapter._wrap_wants_callback, (self,))
|
||||
|
||||
def _wrap_wants_callback(self):
|
||||
self._ret_val = self._policy.wants()
|
||||
self._g_mutex.unlock()
|
||||
|
||||
## @brief Return the global shared variable with the methods' last return value
|
||||
def get_return_value(self):
|
||||
return self._ret_val
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue