Unless VxWorks supports some kind of shared/rwlock like the POSIX one, I am afraid it is going to be a bit more complicated than just simple.
I would suggest using POSIX pthread_rwlock_t
, if you have it. If you don't and VxWorks does not offer any equivalent alternative, you will have to build one using other primitives. It is possible to build a rwlock on top of 2 semaphores and 3 mutexes and two integer variables. See Concurrent Control with "Readers" and "Writers"; P.J. Courtois, F. Heymans, and D.L. Parnas; MBLE Research Laboratory; Brussels, Belgium.