diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-07-09 01:56:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-09 01:56:00 +0200 |
commit | 57b3450f4d232cd53d3b9a0f6566806d73fa4156 (patch) | |
tree | be4700d9f1b3dae8972cfe6ee314a75b6a1553f9 /src/vm/synch.h | |
parent | b7d37fe7317381a64aa6331d24e6a9f3d6aab6c5 (diff) | |
download | coreclr-57b3450f4d232cd53d3b9a0f6566806d73fa4156.tar.gz coreclr-57b3450f4d232cd53d3b9a0f6566806d73fa4156.tar.bz2 coreclr-57b3450f4d232cd53d3b9a0f6566806d73fa4156.zip |
Fix exceptions in GC (#6192)
The GC code in general doesn't expect exceptions to be thrown from functions
it calls. However, the event creation functions were in fact throwing, so
in case of OOM, exception would be thrown from various places of the code.
This change creates non-throwing versions of the event creation functions
and replaces all usages of the throwing ones in the GC.
In addition, I've removed blocks with PAL_TRY that were under NO_CATCH_HANDLERS
define and also added Object::SetAppDomainNoThrow, which allowed me to removed
EX_TRY from GCHeap::StressHeap where the Object::SetAppDomain was called before.
Diffstat (limited to 'src/vm/synch.h')
-rw-r--r-- | src/vm/synch.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vm/synch.h b/src/vm/synch.h index f63a78d10d..8605eea062 100644 --- a/src/vm/synch.h +++ b/src/vm/synch.h @@ -36,6 +36,10 @@ public: void CreateAutoEvent(BOOL bInitialState); void CreateManualEvent(BOOL bInitialState); + // Non-throwing variants of the functions above + BOOL CreateAutoEventNoThrow(BOOL bInitialState); + BOOL CreateManualEventNoThrow(BOOL bInitialState); + void CreateMonitorEvent(SIZE_T Cookie); // robust against initialization races - for exclusive use by AwareLock #ifdef FEATURE_RWLOCK @@ -47,6 +51,10 @@ public: void CreateOSAutoEvent (BOOL bInitialState); void CreateOSManualEvent (BOOL bInitialState); + // Non-throwing variants of the functions above + BOOL CreateOSAutoEventNoThrow (BOOL bInitialState); + BOOL CreateOSManualEventNoThrow (BOOL bInitialState); + void CloseEvent(); BOOL IsValid() const |