Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gsomix committed Jul 10, 2012
1 parent fa071cb commit 6aae77b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/shogun/lib/Map.h
Expand Up @@ -83,7 +83,9 @@ IGNORE_IN_CLASSLIST template<class K, class T> class CMap: public CSGObject

array=new DynArray<CMapNode<K, T>*>(reserved, tracable);

#ifdef HAVE_PTHREAD
PTHREAD_LOCK_INIT(&lock);
#endif
}

/** Default destructor */
Expand Down Expand Up @@ -186,10 +188,7 @@ IGNORE_IN_CLASSLIST template<class K, class T> class CMap: public CSGObject
{
int32_t index=hash(key);
CMapNode<K, T>* result=chain_search(index, key);

#ifdef HAVE_PTHREAD
PTHREAD_LOCK(&lock);
#endif

if (result!=NULL)
return result->data;
else
Expand All @@ -199,10 +198,6 @@ IGNORE_IN_CLASSLIST template<class K, class T> class CMap: public CSGObject

return result->data;
}

#ifdef HAVE_PTHREAD
PTHREAD_UNLOCK(&lock);
#endif
}

/** Set element by key
Expand Down

0 comments on commit 6aae77b

Please sign in to comment.