[stacklessexamples] r179 committed - Small internal C.C.P. changes.

0 views
Skip to first unread message

stackles...@googlecode.com

unread,
Feb 1, 2011, 9:03:47 PM2/1/11
to stackless-exa...@googlegroups.com
Revision: 179
Author: richar...@gmail.com
Date: Tue Feb 1 18:02:50 2011
Log: Small internal C.C.P. changes.
http://code.google.com/p/stacklessexamples/source/detail?r=179

Modified:
/trunk/libraries/stacklesslib/locks.py
/trunk/libraries/stacklesslib/main.py
/trunk/libraries/stacklesslib/util.py

=======================================
--- /trunk/libraries/stacklesslib/locks.py Sun Dec 26 17:09:57 2010
+++ /trunk/libraries/stacklesslib/locks.py Tue Feb 1 18:02:50 2011
@@ -207,7 +207,8 @@
timeout = endtime - elapsed_time()
if timeout < 0:
return result #a timeout occurred
- result = self.wait(timeout)
+ self.wait(timeout)
+ result = predicate()
return result

def notify(self, n=1):
=======================================
--- /trunk/libraries/stacklesslib/main.py Sun Dec 26 17:09:57 2010
+++ /trunk/libraries/stacklesslib/main.py Tue Feb 1 18:02:50 2011
@@ -164,10 +164,10 @@
""" Perform whatever tasks required to wake up sleeping tasks """
event_queue.pump()

- def run_tasklets(self):
+ def run_tasklets(self, run_for=0):
""" Run tasklets for as long as necessary """
try:
- stackless.run()
+ stackless.run(run_for)
except Exception:
self.handle_run_error(sys.exc_info())

=======================================
--- /trunk/libraries/stacklesslib/util.py Sun Dec 26 17:09:57 2010
+++ /trunk/libraries/stacklesslib/util.py Tue Feb 1 18:02:50 2011
@@ -53,14 +53,15 @@
d[stackless.getcurrent()] = a
return a

- def __getattribute__(self, name):
+ def __getattribute__(self, name):
a = object.__getattribute__(self, "get_dict")()
if name == "__dict__":
return a
- try:
+ elif name in a:
return a[name]
- except KeyError:
- raise AttributeError, name
+ else:
+ return object.__getattribute__(self, name)
+

def __setattr__(self, name, value):
a = object.__getattribute__(self, "get_dict")()

Reply all
Reply to author
Forward
0 new messages