Skip to content

Commit

Permalink
CURLBindings: Prevent GC from deadlocking in some cases
Browse files Browse the repository at this point in the history
The idea here is to avoid GC during these instructions since it seems to create some deadlock? I think this solves part of the issue.
  • Loading branch information
Dimensionscape authored Aug 13, 2024
1 parent 95baa58 commit 06ca5d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions project/src/net/curl/CURLBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,8 @@ namespace lime {


int lime_curl_multi_perform (value multi_handle) {


hx::EnterGCFreeZone();
curl_gc_mutex.Lock ();

int runningHandles = 0;
Expand All @@ -2521,7 +2522,8 @@ namespace lime {
curlMultiRunningHandles[multi_handle] = runningHandles;

curl_gc_mutex.Unlock ();

hx::ExitGCFreeZone();

return result;

}
Expand Down Expand Up @@ -2889,4 +2891,4 @@ extern "C" int lime_curl_register_prims () {

return 0;

}
}

0 comments on commit 06ca5d6

Please sign in to comment.