diff options
author | Koundinya Veluri <kouvel@microsoft.com> | 2015-08-21 11:43:34 -0700 |
---|---|---|
committer | Koundinya Veluri <kouvel@microsoft.com> | 2015-08-26 21:35:47 -0700 |
commit | 96846758a0df94985aedc6c301a8576ee1f1da4b (patch) | |
tree | 45206616b8e94b745fdcca3a4a76f030443b2c4a /src/pal/tests/palsuite/threading/WaitForSingleObject | |
parent | b7d38a0ff5a4faa3ed6da5b8e0e375b9e91e6a77 (diff) | |
download | coreclr-96846758a0df94985aedc6c301a8576ee1f1da4b.tar.gz coreclr-96846758a0df94985aedc6c301a8576ee1f1da4b.tar.bz2 coreclr-96846758a0df94985aedc6c301a8576ee1f1da4b.zip |
Return error upon attemping to create named objects in PAL.
Update PAL APIs that create named objects (mutex, semaphore, event, file mapping) to return a not-supported error code. It was decided to not support cross-process synchronization in PAL at present time due to complexities involved in reliably emulating Windows' behavior. @stephentoub has already made changes on the FX side to throw PlatformNotSupportedException in these cases.
Related to issue #1237.
Diffstat (limited to 'src/pal/tests/palsuite/threading/WaitForSingleObject')
3 files changed, 14 insertions, 22 deletions
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c index 5d231cd749..303f9033e6 100644 --- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c +++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c @@ -60,9 +60,9 @@ int __cdecl main( int argc, char **argv ) */ /* Create a mutex that is not in the signalled state */ - hMutex = CreateMutex( NULL, //No security attributes - TRUE, //Iniitally owned - "SomeMutex"); //Name of mutex + hMutex = CreateMutex(NULL, //No security attributes + TRUE, //Iniitally owned + NULL); //Name of mutex if (hMutex == NULL) { diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c index f28d1a5a00..dff346e70d 100644 --- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c +++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c @@ -54,10 +54,9 @@ int __cdecl main(int argc, char **argv) } //Create Mutex - hMutex = CreateMutex( - NULL, // no security attributes - FALSE, // initially not owned - "MutexToProtectGlobalCounter"); // name of mutex + hMutex = CreateMutex(NULL, // no security attributes + FALSE, // initially not owned + NULL); // name of mutex //Check for Mutex Creation diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c index 7bea24bbd6..bfbebb20c7 100644 --- a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c +++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c @@ -25,13 +25,12 @@ BOOL WaitForSingleObjectTest() LPSECURITY_ATTRIBUTES lpEventAttributes = 0; BOOL bManualReset = TRUE; BOOL bInitialState = TRUE; - LPCTSTR lpName = "Event #6"; HANDLE hEvent; /* Create an event, and ensure the HANDLE is valid */ hEvent = CreateEvent(lpEventAttributes, bManualReset, - bInitialState, lpName); + bInitialState, NULL); if (hEvent != INVALID_HANDLE_VALUE) { @@ -44,8 +43,7 @@ BOOL WaitForSingleObjectTest() if (dwRet != WAIT_OBJECT_0) { - Trace("WaitForSingleObjectTest:WaitForSingleObject %s " - "failed (%x)\n",lpName,GetLastError()); + Trace("WaitForSingleObjectTest:WaitForSingleObject failed (%x)\n", GetLastError()); } else { @@ -53,15 +51,13 @@ BOOL WaitForSingleObjectTest() if (!bRet) { - Trace("WaitForSingleObjectTest:CloseHandle %s " - "failed (%x)\n",lpName,GetLastError()); + Trace("WaitForSingleObjectTest:CloseHandle failed (%x)\n", GetLastError()); } } } else { - Trace("WaitForSingleObjectTest:CreateEvent %s " - "failed (%x)\n",lpName,GetLastError()); + Trace("WaitForSingleObjectTest:CreateEvent failed (%x)\n", GetLastError()); } /* If the first section passed, Create another event, with the @@ -75,7 +71,7 @@ BOOL WaitForSingleObjectTest() bInitialState = FALSE; hEvent = CreateEvent( lpEventAttributes, - bManualReset, bInitialState, lpName); + bManualReset, bInitialState, NULL); if (hEvent != INVALID_HANDLE_VALUE) { @@ -88,8 +84,7 @@ BOOL WaitForSingleObjectTest() if (dwRet != WAIT_TIMEOUT) { - Trace("WaitForSingleObjectTest:WaitForSingleObject %s " - "failed (%x)\n",lpName,GetLastError()); + Trace("WaitForSingleObjectTest:WaitForSingleObject failed (%x)\n", GetLastError()); } else { @@ -97,15 +92,13 @@ BOOL WaitForSingleObjectTest() if (!bRet) { - Trace("WaitForSingleObjectTest:CloseHandle %s failed " - "(%x)\n",lpName,GetLastError()); + Trace("WaitForSingleObjectTest:CloseHandle failed (%x)\n", GetLastError()); } } } else { - Trace("WaitForSingleObjectTest::CreateEvent %s failed " - "(%x)\n",lpName,GetLastError()); + Trace("WaitForSingleObjectTest::CreateEvent failed (%x)\n", GetLastError()); } } return bRet; |