From f809f3a716ec95710c3dde6e6331024f9d12f935 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 14 Mar 2000 21:18:05 +0000 Subject: [PATCH] lock for ++nthreadPrivate --- src/libCom/osi/os/vxWorks/osdThread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libCom/osi/os/vxWorks/osdThread.c b/src/libCom/osi/os/vxWorks/osdThread.c index 1aaac01d3..1e8593ba9 100644 --- a/src/libCom/osi/os/vxWorks/osdThread.c +++ b/src/libCom/osi/os/vxWorks/osdThread.c @@ -241,9 +241,14 @@ void threadShow(threadId id,unsigned int level) */ threadPrivateId threadPrivateCreate() { + static int lock = 0; threadPrivateId id; + threadInit(); + /*lock is necessary because ++nthreadPrivate may not be indivisible*/ + while(!vxTas(&lock)) taskDelay(1); id = (threadPrivateId)++nthreadPrivate; + lock = 0; return(id); }