I have several processes, written in C++, accessing to a critical section (read/write a file) and this access is controlled by a mutex. So far everything has gone well, but now I have to redesign my platform and there is a bash script that also has to read/write the file. Is there any library/command that implements a mutex/semaphore/lock mechanism and can be used in both bash scripts and C++?
When I had to work with mutex in bash scripts, I used to create a directory with mkdir -> Is there any mutex/semaphore mechanism in shell scripts? but I am not very sure what to do in this case.