Search:

Type: Posts; User: antred

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,852

    Um, yeah, I'm aware of that. That's the whole...

    Um, yeah, I'm aware of that. That's the whole point of me suggesting that he use std::lock_guard instead of doing it manually. :p
  2. Replies
    9
    Views
    1,852

    Hate to quote myself, but apparently I can no...

    Hate to quote myself, but apparently I can no longer edit my post. Obviously I meant what happens if something throws an exception after you've locked the mutex but before you've unlocked it?
  3. Replies
    9
    Views
    1,852

    From your code sample above: mtx.lock();...

    From your code sample above:



    mtx.lock();
    cur_best = best;
    mtx.unlock();


    Don't lock / unlock mutexes explicitly. It's prone to errors ... not so much in such a simple case, but what...
Results 1 to 3 of 3