get rid of threadIsReady
This commit is contained in:
@@ -192,12 +192,6 @@ threadIsSuspended (threadId id)
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
threadIsReady (threadId id)
|
||||
{
|
||||
return !threadIsSuspended(id);
|
||||
}
|
||||
|
||||
void
|
||||
threadSleep (double seconds)
|
||||
{
|
||||
|
||||
@@ -319,14 +319,6 @@ epicsShareFunc int epicsShareAPI threadIsSuspended (threadId id)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* threadIsReady ()
|
||||
*/
|
||||
epicsShareFunc int epicsShareAPI threadIsReady (threadId id)
|
||||
{
|
||||
return !threadIsSuspended (id);
|
||||
}
|
||||
|
||||
/*
|
||||
* threadSleep ()
|
||||
*/
|
||||
@@ -376,4 +368,4 @@ epicsShareFunc void * epicsShareAPI threadPrivateGet (threadVarId id)
|
||||
{
|
||||
struct osdThreadPrivate *pPvt = (struct osdThreadPrivate *) id;
|
||||
return (void *) TlsGetValue (pPvt->key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,13 +260,9 @@ int threadIsEqual(threadId id1, threadId id2)
|
||||
return(pthread_equal(p1->tid,p2->tid));
|
||||
}
|
||||
|
||||
int threadIsReady(threadId id) {
|
||||
threadInfo *pthreadInfo = (threadInfo *)id;
|
||||
return(pthreadInfo->isSuspended ? 0 : 1);
|
||||
}
|
||||
|
||||
int threadIsSuspended(threadId id) {
|
||||
return(threadIsReady(id) ? 0 : 1);
|
||||
threadInfo *pthreadInfo = (threadInfo *)id;
|
||||
return(pthreadInfo->isSuspended ? 1 : 0);
|
||||
}
|
||||
|
||||
void threadSleep(double seconds)
|
||||
@@ -290,3 +286,44 @@ threadId threadGetIdSelf(void) {
|
||||
pthreadInfo = (threadInfo *)pthread_getspecific(getpthreadInfo);
|
||||
return((threadId)pthreadInfo);
|
||||
}
|
||||
|
||||
threadVarId threadPrivateCreate(void)
|
||||
{
|
||||
pthread_key_t *key;
|
||||
int status;
|
||||
|
||||
key = callocMustSucceed(1,sizeof(pthread_key_t),"threadPrivateCreate");
|
||||
status = pthread_key_create(key,0);
|
||||
checkStatusQuit(status,"pthread_key_create","threadPrivateCreate");
|
||||
return((threadVarId)key);
|
||||
}
|
||||
|
||||
void threadPrivateDelete(threadVarId id)
|
||||
{
|
||||
pthread_key_t *key = (pthread_key_t *)id;
|
||||
int status;
|
||||
|
||||
status = pthread_key_delete(*key);
|
||||
checkStatusQuit(status,"pthread_key_delete","threadPrivateDelete");
|
||||
}
|
||||
|
||||
void threadPrivateSet (threadVarId id, void *value)
|
||||
{
|
||||
pthread_key_t *key = (pthread_key_t *)id;
|
||||
int status;
|
||||
|
||||
status = pthread_setspecific(*key,value);
|
||||
checkStatusQuit(status,"pthread_setspecific","threadPrivateSet");
|
||||
}
|
||||
|
||||
void *threadPrivateGet(threadVarId id)
|
||||
{
|
||||
pthread_key_t *key = (pthread_key_t *)id;
|
||||
int status;
|
||||
void *value;
|
||||
|
||||
value = pthread_getspecific(*key);
|
||||
if(!value)
|
||||
errlogPrintf("threadPrivateGet: pthread_getspecific returned 0\n");
|
||||
return(value);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ of this distribution.
|
||||
#include "osiThread.h"
|
||||
#include "osiTimer.h"
|
||||
#include "errlog.h"
|
||||
#include "taskwd.h"
|
||||
#include "tsStamp.h"
|
||||
|
||||
static void expire(void *pPrivate);
|
||||
|
||||
Reference in New Issue
Block a user