Attention is currently required from: Julius Werner, Eric Peers, Felix Held. Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56229 )
Change subject: lib/thread: Add thread_handle ......................................................................
Patch Set 6:
(4 comments)
File src/include/thread.h:
https://review.coreboot.org/c/coreboot/+/56229/comment/530ca211_4ff36673 PS5, Line 69: wait_for_thread
nit: thread_wait() to keep with the namespace prefix?
I went with thread_join to match the terminology used by other languages/APIs.
https://review.coreboot.org/c/coreboot/+/56229/comment/0995183b_d6c879c5 PS5, Line 111: return CB_ERR;
Could probably be dead_code()?
I moved it out of the #if guards. This will result in a linker error. It will require we guard calls to `wait_for_thread` with `if (CONFIG(COOP_MULTITASKING))`, but as you pointed out in the APOB CL, that helps with readability.
File src/lib/thread.c:
https://review.coreboot.org/c/coreboot/+/56229/comment/5c3f5304_8982fd55 PS5, Line 408: printk(BIOS_DEBUG, "waiting for thread\n");
Same as with the mutex, I'm not sure these are super useful. […]
I think they are helpful in ensuring that we don't block unexpectedly:
e.g.,
BS: BS_PAYLOAD_LOAD entry times (exec / console): 18 / 0 ms waiting for thread took 0 us
I went ahead and made it BIOS_SPEW to reduce the noise.
https://review.coreboot.org/c/coreboot/+/56229/comment/8fb008f4_7095c58d PS5, Line 411: thread_yield_microseconds(10);
Why not 0?
Switches it to thread_yield which uses 0.