@@ -533,16 +533,19 @@ class hxSemaphore : public hx::Object {
533
533
#endif
534
534
535
535
void Acquire () {
536
+ hx::EnterGCFreeZone ();
536
537
#if HX_WINDOWS
537
538
WaitForSingleObject (sem, INFINITE);
538
539
#elif defined(POSIX_SEMAPHORE)
539
540
sem_wait (&sem);
540
541
#elif defined(APPLE_SEMAPHORE)
541
542
dispatch_semaphore_wait (sem, DISPATCH_TIME_FOREVER);
542
543
#endif
544
+ hx::ExitGCFreeZone ();
543
545
}
544
546
545
547
bool TryAcquire (double timeout) {
548
+ hx::AutoGCFreeZone blocking;
546
549
#ifdef HX_WINDOWS
547
550
return WaitForSingleObject (sem, (DWORD)((FLOAT)timeout * 1000.0 )) == 0 ;
548
551
#elif defined(POSIX_SEMAPHORE)
@@ -678,13 +681,15 @@ class hxCondition : public hx::Object {
678
681
}
679
682
680
683
void Acquire () {
684
+ hx::EnterGCFreeZone ();
681
685
#ifdef HX_WINDOWS
682
686
#ifndef HXCPP_WINXP_COMPAT
683
687
EnterCriticalSection (&cs);
684
688
#endif
685
689
#else
686
690
pthread_mutex_lock (mutex);
687
691
#endif
692
+ hx::ExitGCFreeZone ();
688
693
}
689
694
690
695
bool TryAcquire () {
@@ -710,16 +715,19 @@ class hxCondition : public hx::Object {
710
715
}
711
716
712
717
void Wait () {
718
+ hx::EnterGCFreeZone ();
713
719
#ifdef HX_WINDOWS
714
720
#ifndef HXCPP_WINXP_COMPAT
715
721
SleepConditionVariableCS (&cond,&cs,INFINITE);
716
722
#endif
717
723
#else
718
724
pthread_cond_wait (cond, mutex);
719
725
#endif
726
+ hx::ExitGCFreeZone ();
720
727
}
721
728
722
729
bool TimedWait (double timeout) {
730
+ hx::AutoGCFreeZone blocking;
723
731
#ifdef HX_WINDOWS
724
732
#ifndef HXCPP_WINXP_COMPAT
725
733
return (bool )SleepConditionVariableCS (&cond, &cs, (DWORD)((FLOAT)timeout * 1000.0 ));
0 commit comments