summaryrefslogtreecommitdiff
path: root/sys/src/libthread/main.c
AgeCommit message (Collapse)Author
2021-10-13libthread: fix debug prints, simplifycinap_lenrek
Do the debuglevel check before calling the print function for _threaddebug, by making it a macro. Do not waste cycles passing arguments. Generalize the _threaddebug function into _threadprint() and add a varargcheck pragma. This function can also be used from _threadassert(). Fix missing arguments in one case, fix trailing newlines in _threaddebug(). Make _threadgetproc()/_threadsetproc() a macro, just dereferencing Proc**_threadprocp. Simplify the mainjump, just call _threadsetproc() directly without that mainp dance. Remove the _schedinit() argument, it uses _threadgetproc() now. Get rid of Mainarg struct, just have a global variable for argc.
2021-10-12libthread: remove more garbage: _threadnotefd, _threadpasserpid.cinap_lenrek
2021-10-12libthread: remove unused skip() functioncinap_lenrek
2021-10-12libthread: deal with _schedfork() and _schedexec() returning -1cinap_lenrek
The current behaviour of the kernel to deadlock itself instead of returning an error on fork. This might change in the future, so prepare libthread to handle this case. For _schedfork(), we'r going to just retry forking on every switch, while for _schedexec(), the exec will fail and send ~0 down the pid channel.
2020-12-19libthread: remove unused _times() functioncinap_lenrek
2015-08-25fix fuckupglenda
2015-08-25import E script from bell labsmischief
2015-02-28libthread: use devdup instead of mounting pipe to /mnt/temp for ↵cinap_lenrek
close-on-exec in procexec() the namespace might be shared by other processes. instead, we create a anonymous pipe with pipe() and use devdup to open one end close-on-exec. this is shorter and avoids the race condition. do not touch Execargs after writing the error message as the process might be gone after the write. this was to manually close the fd which isnt neccesary as the kernel will do it for us on the following exit.
2013-12-06libthread: avoid calling thread waiting for fork/execed process to finish if ↵cinap_lenrek
we dont have to we do not need to wait for fork/execed program to finish when not collecting waitmsg. this reduces the number of rio processes hanging arround for each window shell just waiting for it to terminate and then dumping the waitmsg.
2012-01-10libc: restoring simple sequential version of dial()cinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen