diff options
| author | rsc <devnull@localhost> | 2004-12-25 21:56:33 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-12-25 21:56:33 +0000 |
| commit | 1544f90960275dc9211bde30329c3258e0e1bf38 (patch) | |
| tree | f55e7a73c03aaa24daa7cc2ad02822b921c477f9 /src/libthread/debug.c | |
| parent | 7788fd54094693384ef5c92c475656dba8819feb (diff) | |
| download | plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.tar.gz plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.zip | |
New thread library
Diffstat (limited to 'src/libthread/debug.c')
| -rw-r--r-- | src/libthread/debug.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/libthread/debug.c b/src/libthread/debug.c deleted file mode 100644 index 14b47c00..00000000 --- a/src/libthread/debug.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "threadimpl.h" - -int _threaddebuglevel; - -void -__threaddebug(ulong flag, char *fmt, ...) -{ - char buf[128]; - va_list arg; - Fmt f; - Proc *p; - - if((_threaddebuglevel&flag) == 0) - return; - - fmtfdinit(&f, 2, buf, sizeof buf); - - p = _threadgetproc(); - if(p==nil) - fmtprint(&f, "noproc "); - else if(p->thread) - fmtprint(&f, "%d.%d ", p->id, p->thread->id); - else - fmtprint(&f, "%d._ ", p->id); - - va_start(arg, fmt); - fmtvprint(&f, fmt, arg); - va_end(arg); - fmtprint(&f, "\n"); - fmtfdflush(&f); -} - -void -_threadassert(char *s) -{ - char buf[256]; - int n; - Proc *p; - - p = _threadgetproc(); - if(p && p->thread) - n = sprint(buf, "%d.%d ", p->pid, p->thread->id); - else - n = 0; - snprint(buf+n, sizeof(buf)-n, "%s: assertion failed\n", s); - write(2, buf, strlen(buf)); - abort(); -} |
