- Previous segmentation fault was due to a faulty call (wrong parameters
to ScriptAdapter.__wrap_sort_queue()). Now prints an error and check for retval before Py_DECREF'ing it. - Fix(?) qsort implementation in Policy - SWIG doesn't understand "uint". Change into more verbose (but surely standard) unsigned int git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@394 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
075e12d14d
commit
a2a492b5d5
5 changed files with 28 additions and 26 deletions
|
@ -21,15 +21,14 @@ _ret_val = None
|
|||
# @endcode
|
||||
class ScriptAdapter :
|
||||
_policy = None
|
||||
_event = None
|
||||
|
||||
def __init__(self, policy):
|
||||
self._policy = policy()
|
||||
print 'ScriptAdapter for policy ', policy, ' loaded'
|
||||
|
||||
def async_configure(self):
|
||||
print 'Calling ', self._policy, ' configure() method.'
|
||||
_g_mutex.lock(ScriptAdapter._wrap_configure, self )
|
||||
print 'Returning from configure() method'
|
||||
|
||||
def _wrap_configure(self):
|
||||
thread.start_new_thread(ScriptAdapter._wrap_configure_callback, (self,))
|
||||
|
@ -40,10 +39,12 @@ class ScriptAdapter :
|
|||
_g_mutex.unlock()
|
||||
|
||||
def async_sort_queue(self, event):
|
||||
_g_mutex.lock(ScriptAdapter._wrap_sort_queue, (self, event))
|
||||
self._event = event
|
||||
_g_mutex.lock(ScriptAdapter._wrap_sort_queue, self)
|
||||
|
||||
def _wrap_sort_queue(self, event):
|
||||
thread.start_new_thread(ScriptAdapter._wrap_sort_queue_callback, (self, event))
|
||||
def _wrap_sort_queue(self):
|
||||
thread.start_new_thread(ScriptAdapter._wrap_sort_queue_callback,
|
||||
(self,self._event))
|
||||
|
||||
def _wrap_sort_queue_callback(self, event):
|
||||
# here we retrieve and pass the ready queue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue