File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ def run_forever(self):
71
71
ret = cb .send (* args )
72
72
if __debug__ :
73
73
log .debug ("Coroutine %s yield result: %s" , cb , ret )
74
- if isinstance (ret , SysCall ):
75
- arg = ret .args [ 0 ]
74
+ if isinstance (ret , SysCall1 ):
75
+ arg = ret .arg
76
76
if isinstance (ret , Sleep ):
77
77
delay = arg
78
78
elif isinstance (ret , IORead ):
@@ -121,22 +121,28 @@ def __init__(self, *args):
121
121
def handle (self ):
122
122
raise NotImplementedError
123
123
124
- class Sleep (SysCall ):
124
+ # Optimized syscall with 1 arg
125
+ class SysCall1 (SysCall ):
126
+
127
+ def __init__ (self , arg ):
128
+ self .arg = arg
129
+
130
+ class Sleep (SysCall1 ):
125
131
pass
126
132
127
- class StopLoop (SysCall ):
133
+ class StopLoop (SysCall1 ):
128
134
pass
129
135
130
- class IORead (SysCall ):
136
+ class IORead (SysCall1 ):
131
137
pass
132
138
133
- class IOWrite (SysCall ):
139
+ class IOWrite (SysCall1 ):
134
140
pass
135
141
136
- class IOReadDone (SysCall ):
142
+ class IOReadDone (SysCall1 ):
137
143
pass
138
144
139
- class IOWriteDone (SysCall ):
145
+ class IOWriteDone (SysCall1 ):
140
146
pass
141
147
142
148
You can’t perform that action at this time.
0 commit comments