FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Decrement the mutex use count after we've unlocked them. by joshaber · Pull Request #876 · nodegit/nodegit · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cc  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 5 additions & 1 deletion generate/templates/manual/src/lock_master.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,13 @@ void LockMasterImpl::Lock(bool acquireMutexes) {
}

void LockMasterImpl::Unlock(bool releaseMutexes) {
std::vector<uv_mutex_t *> objectMutexes = GetMutexes(releaseMutexes * -1);
// Get the mutexes but don't decrement their use count until after we've
// unlocked them all.
std::vector<uv_mutex_t *> objectMutexes = GetMutexes(0);

std::for_each(objectMutexes.begin(), objectMutexes.end(), uv_mutex_unlock);

GetMutexes(releaseMutexes * -1);
}

void LockMasterImpl::CleanupMutexes() {
Expand Down

Back | FazBrowse Home | New Git URL