feat: extend user and waitanyfast
This commit is contained in:
1 parent
baece1a2b0
commit
40b71851f5
3 files changed
+64
-5
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#include "ulib.h"
|
||||
|
||||
/*
|
||||
* Only ever spawned by waitanytest.c. Sleeps a real, non-trivial amount
|
||||
* before exiting -- long enough that waitanytest.c's own userWaitAny()
|
||||
* calls cannot possibly race past it by luck: its first call happens
|
||||
* essentially immediately after spawning both children (see
|
||||
* waitanytest.c's own file comment), so this thread genuinely cannot be
|
||||
* Dead yet by the time that first call runs. That is what forces
|
||||
* waitanytest.c's SECOND userWaitAny() call to take threadJoinAnyChild's
|
||||
* waitScanNoneDead branch and actually block through the real
|
||||
* retry-syscall path, rather than getting lucky and finding it already
|
||||
* dead too.
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
print("waitanyslow: start, pid=");
|
||||
printDec(userGetpid());
|
||||
print("\n");
|
||||
userSleep(150);
|
||||
print("waitanyslow: exiting now\n");
|
||||
return 33;
|
||||
}
|
||||
Reference in new issue
Block a user