2 ms·
Have both F and I call a private F_unlocked. I assume the issue is you can't (easily) change I (for example F is malloc). Then any solution in practice would l
by gpderetta 4y ago
Have both F and I call a private F_unlocked.
I assume the issue is you can't (easily) change I (for example F is malloc). Then any solution in practice would look like a recursive mutex.
That's alright, recursive mutexes are bad, but one legitimate use case is retrofitting thread safety on top on a non thread safe interface (infamously xlib was made thread safe by just bolting on a global recursive mutex).