thread pool: don't use reserved names

Avoid global symbols with leading underscore
This commit is contained in:
Michael Davidsaver
2014-07-29 12:21:07 -04:00
parent b1a8b2f20e
commit 716f2679a7
3 changed files with 8 additions and 8 deletions

View File

@@ -94,8 +94,8 @@ epicsShareFunc int epicsThreadPoolWait(epicsThreadPool* pool, double timeout);
* the argument passed to the job callback
* will be the epicsJob*
*/
#define EPICSJOB_SELF _epicsJobArgSelf
epicsShareExtern void* _epicsJobArgSelf;
#define EPICSJOB_SELF epicsJobArgSelfMagic
epicsShareExtern void* epicsJobArgSelfMagic;
/* creates, but does not add, a new job.
* If pool in NULL then the job is not associated with any pool and

View File

@@ -22,7 +22,7 @@
#include "epicsThreadPool.h"
#include "poolPriv.h"
void* _epicsJobArgSelf = &_epicsJobArgSelf;
void* epicsJobArgSelfMagic = &epicsJobArgSelfMagic;
static
void workerMain(void* arg)
@@ -148,7 +148,7 @@ epicsJob* epicsJobCreate(epicsThreadPool* pool,
if(!job)
return NULL;
if(arg==&_epicsJobArgSelf)
if(arg==&epicsJobArgSelfMagic)
arg=job;
job->pool=NULL;

View File

@@ -102,7 +102,7 @@ cleanup:
}
static
void _epicsThreadPoolControl(epicsThreadPool* pool, epicsThreadPoolOption opt, unsigned int val)
void epicsThreadPoolControlImpl(epicsThreadPool* pool, epicsThreadPoolOption opt, unsigned int val)
{
if(pool->freezeopt)
return;
@@ -147,7 +147,7 @@ void _epicsThreadPoolControl(epicsThreadPool* pool, epicsThreadPoolOption opt, u
void epicsThreadPoolControl(epicsThreadPool* pool, epicsThreadPoolOption opt, unsigned int val)
{
epicsMutexMustLock(pool->guard);
_epicsThreadPoolControl(pool, opt, val);
epicsThreadPoolControlImpl(pool, opt, val);
epicsMutexUnlock(pool->guard);
}
@@ -206,8 +206,8 @@ void epicsThreadPoolDestroy(epicsThreadPool *pool)
epicsMutexMustLock(pool->guard);
/* run remaining queued jobs */
_epicsThreadPoolControl(pool, epicsThreadPoolQueueAdd, 0);
_epicsThreadPoolControl(pool, epicsThreadPoolQueueRun, 1);
epicsThreadPoolControlImpl(pool, epicsThreadPoolQueueAdd, 0);
epicsThreadPoolControlImpl(pool, epicsThreadPoolQueueRun, 1);
nThr=pool->threadsRunning;
pool->freezeopt = 1;