4 ms·
That's not any easier than RAII, although I wish C++ had the lock syntax from C# lock (object) { // do stuff }
by pelorat 4y ago
That's not any easier than RAII, although I wish C++ had the lock syntax from C#
lock (object) {
// do stuff
}
- gpderetta 4y agoThat's commonly done in C++ with macro, but the lock(object) syntax doesn't prevent doing stuff with object without locking the mutex, while the synchronized pattern does.