diff --git a/src/libCom/test/threadTest.c b/src/libCom/test/threadTest.c index 2d0ebfd4a..784fa9fc9 100644 --- a/src/libCom/test/threadTest.c +++ b/src/libCom/test/threadTest.c @@ -20,13 +20,19 @@ of this distribution. #include "osiSem.h" #include "errlog.h" +threadPrivateId privateKey; static void threadFunc(void *arg) { + int myPrivate; int argvalue = *(int *)arg; + myPrivate = argvalue; + threadPrivateSet(privateKey,(void *)argvalue); errlogPrintf("threadFunc %d starting\n",argvalue); threadSleep(2.0); - errlogPrintf("threadFunc %d stopping\n",argvalue); + argvalue = -1; + argvalue = (int)threadPrivateGet(privateKey); + errlogPrintf("threadFunc %d stopping myPrivate %d\n",argvalue,myPrivate); } void threadTest(int ntasks,int verbose) @@ -48,6 +54,7 @@ void threadTest(int ntasks,int verbose) errlogPrintf("threadTest starting\n"); stackSize = threadGetStackSize(threadStackSmall); errlogPrintf("stackSize %u\n",stackSize); + privateKey = threadPrivateCreate(); for(i=0; i