summaryrefslogtreecommitdiff
path: root/plugins/JSON/Source/JSONNode_Mutex.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/JSON/Source/JSONNode_Mutex.cpp
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/JSON/Source/JSONNode_Mutex.cpp')
-rw-r--r--plugins/JSON/Source/JSONNode_Mutex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/JSON/Source/JSONNode_Mutex.cpp b/plugins/JSON/Source/JSONNode_Mutex.cpp
index 0f0dbe5d7b..f047f58403 100644
--- a/plugins/JSON/Source/JSONNode_Mutex.cpp
+++ b/plugins/JSON/Source/JSONNode_Mutex.cpp
@@ -73,14 +73,14 @@ void JSONNode::lock(int thread){
//make sure that the same thread isn't locking it more than once (possible due to complex ref counting)
std::map<int, std::map<void *, unsigned int> >::iterator it = threadlocks.find(thread);
- if (it == threadlocks.end()){
+ if (it == threadlocks.end()) {
std::map<void *, unsigned int> newthread;
newthread[thislock] = 1;
threadlocks.insert(std::pair<int, std::map<void *, unsigned int> >(thread, newthread));
} else { //this thread already has some things locked, check if the current mutex is
std::map<void *, unsigned int> & newthread = it -> second;
std::map<void *, unsigned int>::iterator locker = newthread.find(thislock);
- if (locker == newthread.end()){ //current mutex is not locked, set it to locked
+ if (locker == newthread.end()) { //current mutex is not locked, set it to locked
newthread.insert(std::pair<void *, unsigned int>(thislock, 1));
} else { //it's already locked, don't relock it
++(locker -> second);
@@ -133,7 +133,7 @@ void internalJSONNode::_set_mutex(void * mutex, bool unset){
if (mutex){
#ifdef JSON_MUTEX_MANAGE
std::map<void *, unsigned int>::iterator it = mutex_manager.find(mutex);
- if (it == mutex_manager.end()){
+ if (it == mutex_manager.end()) {
mutex_manager.insert(std::pair<void *, unsigned int>(mutex, 1));
} else {
++it -> second;
@@ -168,7 +168,7 @@ void internalJSONNode::_unset_mutex(void){
if (mylock){
mut.push_back(JSON_NEW(JSONNode(JSON_TEXT("this"), (long)mylock)));
std::map<void *, unsigned int>::iterator it = mutex_manager.find(mylock);
- if (it == mutex_manager.end()){
+ if (it == mutex_manager.end()) {
mut.push_back(JSON_NEW(JSONNode(JSON_TEXT("references"), JSON_TEXT("error"))));
} else {
mut.push_back(JSON_NEW(JSONNode(JSON_TEXT("references"), it -> second)));