diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-10-13 17:08:26 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-10-13 17:08:26 +0000 |
commit | 5a807265a819206f8342ab3a23b940a0c75049fc (patch) | |
tree | a84effb4eb8852b1346259b98772c5c269f91e09 /sys/src/libthread/note.c | |
parent | 3fe3e370e3bcad21b61aec6cbf5d11a9398e805b (diff) |
libthread: fix debug prints, simplify
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.
Diffstat (limited to 'sys/src/libthread/note.c')
-rw-r--r-- | sys/src/libthread/note.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/libthread/note.c b/sys/src/libthread/note.c index c04e3e1a2..fcbbf8c07 100644 --- a/sys/src/libthread/note.c +++ b/sys/src/libthread/note.c @@ -72,7 +72,7 @@ delayednotes(Proc *p, void *v) break; } if(i==NFN){ - _threaddebug(DBGNOTE, "Unhandled note %s, proc %p\n", n->s, p); + _threaddebug(DBGNOTE, "Unhandled note %s, proc %p", n->s, p); if(v != nil) noted(NDFLT); else if(strncmp(n->s, "sys:", 4)==0) @@ -94,7 +94,7 @@ _threadnote(void *v, char *s) noted(NDFLT); if(_threadexitsallstatus){ - _threaddebug(DBGNOTE, "Threadexitsallstatus = '%s'\n", _threadexitsallstatus); + _threaddebug(DBGNOTE, "Threadexitsallstatus = '%s'", _threadexitsallstatus); _exits(_threadexitsallstatus); } |