This is cheating a bit, but we need a pointer to our Runtime stored so we can call yield on it even if we don't have a reference to it.
(&self)
| 98 | /// This is cheating a bit, but we need a pointer to our Runtime stored so we can call yield on it even if |
| 99 | /// we don't have a reference to it. |
| 100 | pub fn init(&self) { |
| 101 | unsafe { |
| 102 | let r_ptr: *const Runtime = self; |
| 103 | RUNTIME = r_ptr as usize; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | /// This is where we start running our runtime. If it is our base task, we call yield until |
| 108 | /// it returns false (which means that there are no tasks scheduled) and we are done. |