mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- The thread-safety code is now subject to conditional compilation.
Both the library and the user code need to be rebuilt with the preprocessor symbol __THREAD_SAFE defined to get thread-safe code. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14843 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_init_exit.c,v 1.19 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: stdio_init_exit.c,v 1.20 2005-02-28 10:07:31 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -193,13 +193,21 @@ __stdio_init(void)
|
||||
if(buffer == NULL)
|
||||
goto out;
|
||||
|
||||
/* Allocate memory for an arbitration mechanism, then
|
||||
initialize it. */
|
||||
lock = AllocVec(sizeof(*lock),MEMF_ANY|MEMF_PUBLIC);
|
||||
if(lock == NULL)
|
||||
goto out;
|
||||
#if defined(__THREAD_SAFE)
|
||||
{
|
||||
/* Allocate memory for an arbitration mechanism, then
|
||||
initialize it. */
|
||||
lock = AllocVec(sizeof(*lock),MEMF_ANY|MEMF_PUBLIC);
|
||||
if(lock == NULL)
|
||||
goto out;
|
||||
|
||||
InitSemaphore(lock);
|
||||
InitSemaphore(lock);
|
||||
}
|
||||
#else
|
||||
{
|
||||
lock = NULL;
|
||||
}
|
||||
#endif /* __THREAD_SAFE */
|
||||
|
||||
/* Check if this stream is attached to a console window. */
|
||||
if(default_file != ZERO)
|
||||
|
||||
Reference in New Issue
Block a user