Replace epicsThreadOptsDefaults() with EPICS_THREAD_OPTS_INIT

The epicsThreadCreate() routines now interpose calls to
epicsThreadGetStackSize() if an enum value is passed.
This commit is contained in:
Andrew Johnson
2019-07-02 17:27:27 -05:00
parent 4b77d5e1c9
commit fbf62189cb
10 changed files with 95 additions and 86 deletions

View File

@@ -40,7 +40,7 @@ private:
};
myThread::myThread(int arg,const char *name) :
thread(*this,name,epicsThreadGetStackSize(epicsThreadStackSmall),50+arg),
thread(*this,name,epicsThreadStackSmall,50+arg),
argvalue(0)
{
argvalue = new int;
@@ -132,16 +132,14 @@ void joinTests(void *arg)
void testJoining()
{
epicsThreadOpts opts;
epicsThreadOptsDefaults(&opts);
opts.priority = 50;
opts.joinable = 1;
epicsThreadOpts opts = EPICS_THREAD_OPTS_INIT;
epicsEvent finished, trigger;
struct joinStuff stuff = {
&opts, &trigger, &finished
};
opts.priority = 50;
opts.joinable = 1;
epicsThreadCreateOpt("parent", &joinTests, &stuff, &opts);
// as selfjoin joins itself, we can't.
@@ -172,9 +170,8 @@ static void thread(void *arg)
static void testOkToBlock()
{
epicsThreadOpts opts = EPICS_THREAD_OPTS_INIT;
epicsThreadOpts opts;
epicsThreadOptsDefaults(&opts);
opts.priority = 50;
opts.joinable = 1;
@@ -190,7 +187,6 @@ static void testOkToBlock()
epicsThreadMustJoin(threadA);
testOk1(infoA.didSomething);
}