mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- The thread-safe system() call now blocks all standard I/O operations
until the function has returned. Which is harsh, but there is no elegant solution to the issue of keeping the same dos.library file handles from concurrent use which SystemTagList() might just end up using. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14898 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_system.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
|
||||
* $Id: stdlib_system.c,v 1.6 2005-03-24 15:31:16 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -35,6 +35,10 @@
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
#ifndef _STIO_HEADERS_H
|
||||
#include "stdio_headers.h"
|
||||
#endif /* _STDIO_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_MEMORY_H
|
||||
@ -172,7 +176,18 @@ system(const char * command)
|
||||
SHOWSTRING(command);
|
||||
|
||||
PROFILE_OFF();
|
||||
|
||||
/* In thread-safe mode, system() operation can interfere with
|
||||
regular file I/O if the same dos.library file handles are
|
||||
involved. Because we really cannot predict which file handles
|
||||
will be associated with the current Output() and Input()
|
||||
streams, we play it safe and just block everything. */
|
||||
__stdio_lock();
|
||||
|
||||
result = SystemTagList((STRPTR)command, (struct TagItem *)system_tags);
|
||||
|
||||
__stdio_unlock();
|
||||
|
||||
PROFILE_ON();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user