summaryrefslogtreecommitdiff
path: root/sys/src/libthread/id.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-09-06 23:25:14 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-09-06 23:25:14 +0200
commitb55315c3fd5d745a3c5b15991dfa1c8c5da7a5ae (patch)
treef8fd9c6d691a00d903cede9ab863d1ff6ff789ff /sys/src/libthread/id.c
parent7562da90e562e65156042574e088d4359a8fccba (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/id.c')
-rw-r--r--sys/src/libthread/id.c42
1 files changed, 1 insertions, 41 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];
-}