//
#include <assert.h>
+#include <pthread.h>
#include <stdint.h>
#include <vector>
#include <map>
{
UCollator* regular;
TCollatorMap collatorsPerOption;
+ pthread_mutex_t collatorsLockObject;
_sort_handle() : regular(nullptr)
{
+ pthread_mutex_init(&collatorsLockObject, NULL);
}
} SortHandle;
ucol_close(it->second);
}
+ pthread_mutex_destroy(&pSortHandle->collatorsLockObject);
+
delete pSortHandle;
}
}
else
{
+ pthread_mutex_lock(&pSortHandle->collatorsLockObject);
+
TCollatorMap::iterator entry = pSortHandle->collatorsPerOption.find(options);
if (entry == pSortHandle->collatorsPerOption.end())
{
{
pCollator = entry->second;
}
+
+ pthread_mutex_unlock(&pSortHandle->collatorsLockObject);
}
return pCollator;