Skip to content

Commit 67cbfe1

Browse files
author
Aidan Lee
committed
std::mutex for __hxcpp_field_to_id
1 parent 0a7b031 commit 67cbfe1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/hx/StdLibs.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ typedef int64_t __int64;
3030
#include <stdio.h>
3131
#include <time.h>
3232
#include <clocale>
33+
#include <mutex>
3334

3435

3536
#ifdef HX_ANDROID
@@ -785,7 +786,7 @@ Dynamic __hxcpp_create_var_args(Dynamic &inArrayFunc)
785786

786787

787788

788-
static HxMutex sgFieldMapMutex;
789+
static std::mutex sgFieldMapMutex;
789790

790791
typedef std::map<std::string,int> StringToField;
791792

@@ -809,7 +810,7 @@ const String &__hxcpp_field_from_id( int f )
809810

810811
int __hxcpp_field_to_id( const char *inFieldName )
811812
{
812-
AutoLock lock(sgFieldMapMutex);
813+
std::lock_guard<std::mutex> lock(sgFieldMapMutex);
813814

814815
if (!sgFieldToStringAlloc)
815816
{

0 commit comments

Comments
 (0)