You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line 61 is commented out in the repository (compared to the printed book):
// self->set_clear_mutex.unlock();
Why?
And it is suspicious that the order of set_clear_mutex and lk locking changes: initially lk is locked first (it must be locked before the call to interruptible_wait) and set_clear_mutex is locked second (in the ctor of custom_lock); but then the order changes in custom_lock::lock().
Is it really correct?
The text was updated successfully, but these errors were encountered:
And one more thing about the listing 9.12. In paragraph following the listing we read: "You can now check for an interruption without worrying about races. If the interrupt flag is set at this point, it was set before you acquired the lock on set_clear_mutex." But set_clear_mutex protects only access to thread_cond and a call to notify_all, not setting a flag. Maybe I'm wrong but as I understand, the flag can be set in some thread using set() function even if another thread has already locked set_clear_mutex.
The line 61 is commented out in the repository (compared to the printed book):
// self->set_clear_mutex.unlock();
Why?
And it is suspicious that the order of set_clear_mutex and lk locking changes: initially lk is locked first (it must be locked before the call to interruptible_wait) and set_clear_mutex is locked second (in the ctor of custom_lock); but then the order changes in custom_lock::lock().
Is it really correct?
The text was updated successfully, but these errors were encountered: