diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-06 23:25:14 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-06 23:25:14 +0200 |
commit | b55315c3fd5d745a3c5b15991dfa1c8c5da7a5ae (patch) | |
tree | f8fd9c6d691a00d903cede9ab863d1ff6ff789ff /sys/src/libthread | |
parent | 7562da90e562e65156042574e088d4359a8fccba (diff) |
libthread: get rid of tprivalloc()/tprivfree()/tprivdata() and _workerdata() (thanks qrstuv)
these functions where undocumented and unused. especially
tprivfree() was buggy missing a unlock() call. theres not
much point in supporting these functions as theres
threaddata() and procdata().
Diffstat (limited to 'sys/src/libthread')
-rw-r--r-- | sys/src/libthread/id.c | 42 | ||||
-rw-r--r-- | sys/src/libthread/threadimpl.h | 4 |
2 files changed, 2 insertions, 44 deletions
diff --git a/sys/src/libthread/id.c b/sys/src/libthread/id.c index ebb563307..22d60f423 100644 --- a/sys/src/libthread/id.c +++ b/sys/src/libthread/id.c @@ -89,13 +89,7 @@ threadgetname(void) void** threaddata(void) { - return &_threadgetproc()->thread->udata[0]; -} - -void** -_workerdata(void) -{ - return &_threadgetproc()->wdata; + return &_threadgetproc()->thread->udata; } void** @@ -103,37 +97,3 @@ procdata(void) { return &_threadgetproc()->udata; } - -static Lock privlock; -static int privmask = 1; - -int -tprivalloc(void) -{ - int i; - - lock(&privlock); - for(i=0; i<NPRIV; i++) - if(!(privmask&(1<<i))){ - privmask |= 1<<i; - unlock(&privlock); - return i; - } - unlock(&privlock); - return -1; -} - -void -tprivfree(int i) -{ - if(i < 0 || i >= NPRIV) - abort(); - lock(&privlock); - privmask &= ~(1<<i); -} - -void** -tprivaddr(int i) -{ - return &_threadgetproc()->thread->udata[i]; -} diff --git a/sys/src/libthread/threadimpl.h b/sys/src/libthread/threadimpl.h index 11545ba05..e3fe6e15f 100644 --- a/sys/src/libthread/threadimpl.h +++ b/sys/src/libthread/threadimpl.h @@ -48,7 +48,6 @@ enum { RENDHASH = 13, Printsize = 2048, - NPRIV = 8, }; struct Rgrp @@ -92,7 +91,7 @@ struct Thread Chanstate chan; /* which channel operation is current */ Alt *alt; /* pointer to current alt structure (debugging) */ - void* udata[NPRIV]; /* User per-thread data pointer */ + void* udata; /* User per-thread data pointer */ }; struct Execargs @@ -131,7 +130,6 @@ struct Proc void *arg; /* passed between shared and unshared stk */ char str[ERRMAX]; /* used by threadexits to avoid malloc */ - void* wdata; /* Lib(worker) per-proc data pointer */ void* udata; /* User per-proc data pointer */ char threadint; /* tag for threadexitsall() */ }; |