diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-08-11 15:40:07 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-08-11 15:40:07 +0000 |
commit | e39a29e36b46bcc6bdbb7952872a33375b13d35a (patch) | |
tree | b6ecc1172f0181beaae2ba485014bfaf014cc5c6 /winsup/cygwin/shared.cc | |
parent | fc43c1d925e8b520e33bfc2aa1494e3d14791684 (diff) | |
download | newlib-e39a29e36b46bcc6bdbb7952872a33375b13d35a.zip newlib-e39a29e36b46bcc6bdbb7952872a33375b13d35a.tar.gz newlib-e39a29e36b46bcc6bdbb7952872a33375b13d35a.tar.bz2 |
* shared.cc (open_shared): Desperately try to get shared memory, only
when DEBUGGING enabled for now.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r-- | winsup/cygwin/shared.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index 65965b5..2524eca 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -93,6 +93,30 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size, { shared_h = CreateFileMapping (INVALID_HANDLE_VALUE, psa, PAGE_READWRITE, 0, size, mapname); +#ifdef DEBUGGING + if (!shared_h && GetLastError () == NO_ERROR) + { + system_printf ("CreateFileMapping %s, %E. Retry Open", mapname); + shared_h = OpenFileMapping (access, FALSE, mapname); + if (!shared_h) + { + system_printf ("OpenFileMapping %s, %E. Retry Create " + "after sleep (check timing problem)", mapname); + Sleep (1000L); + shared_h = CreateFileMapping (INVALID_HANDLE_VALUE, psa, + PAGE_READWRITE, 0, size, + mapname); + if (!shared_h) + system_printf ("Retried CreateFileMapping %s, %E.", + mapname); + else + system_printf ("Retried CreateFileMapping %s succeeded!", + mapname); + } + else + system_printf ("OpenFileMapping %s succeeded!", mapname); + } +#endif if (GetLastError () == ERROR_ALREADY_EXISTS) m = SH_JUSTOPEN; } |