3/12 What's the simplest way to add a mutex to C function? I understand
threading issues, but something is munging data in my sockets, and I
want to guarantee that only one thread is touching a certain array at
a time. TIA.
\_ How nice. Why don't you learn how to format instead of waiting
for one of our poor OCD inflicted nerds to do it for you?
\_ afflicted
\_???? Shouldn't your thread library that you are using provide
this functionality???
\_ isn't there an API like win32 api if on windows?
\_ I was hoping there was something quicker/easier-- no libraries,
just... I don't know, OS? How effective would incrementing
decrementing my own static mutex be?
\_ Well, unless you use OS calls for a mutex, it's not really a
mutex. Are you thinking you can just use a static variable
and manage it yourself? Which OS is this?
\_ in some os's you could get by just exclusively opening
a file
\_ some sort of Singleton class and have an being accessed field? |