MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / init

Method init

user/src/bin/stackful_coroutine.rs:100–105  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 2

_startFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected