Do locking against fclose() when doing fdopen()
authorStefan Vogel <sv@exept.de>
Tue, 28 Jul 2009 17:17:33 +0200
changeset 11813 9ccd2b0ca724
parent 11812 fae9f7c22dbd
child 11814 206dc893c632
Do locking against fclose() when doing fdopen()
FileStream.st
--- a/FileStream.st	Tue Jul 28 13:32:44 2009 +0200
+++ b/FileStream.st	Tue Jul 28 17:17:33 2009 +0200
@@ -1261,7 +1261,10 @@
                 } while ((handle == INVALID_HANDLE_VALUE) && (__threadErrno == EINTR));
           }
           if (handle != INVALID_HANDLE_VALUE) {
+              extern void __stxWrapApiEnterCritical(), __stxWrapApiLeaveCritical();
+              __stxWrapApiEnterCritical();
               f = fdopen(_open_osfhandle((long)handle, O_BINARY), __openmode);
+              __stxWrapApiLeaveCritical();
           } else {
               f = NULL;
           }
@@ -1641,7 +1644,7 @@
 !FileStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.132 2009-07-28 11:32:44 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.133 2009-07-28 15:17:33 stefan Exp $'
 ! !
 
 FileStream initialize!