httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject more multithread unsafe stuff
Date Fri, 19 Dec 1997 09:59:25 GMT
The following functions are thread unsafe, and we use them (some of them
in core code, like in main/util.c): 

ctime
asctime
localtime
gmtime
strtok

Now, it depends on how the win32 libc is implemented... those could be
implemented using thread-specific data, and be semi-safe.  I suspect that
must be the case, because we use them in such core code that you win32
folks would surely have seen some insanity by now.  If they're implemented
using thread-specific data it just means you can't pass the pointers
returned to different threads... 

We could use a file like this to prevent the accidental use of routines
that aren't thread safe.  But not until the code is rewritten to avoid
them. 

Dean

cat >os/win32/unsafe.c <<EOF
/* this doesn't exist, and if unsafe.o is ever linked into the app
 * it will cause a link-time error.
 */
extern int use_of_unsafe_threaded_function; 

int ctime(void) { return use_of_unsafe_threaded_function; }
int asctime(void) { return use_of_unsafe_threaded_function; }
int localtime(void) { return use_of_unsafe_threaded_function; }
int gmtime(void) { return use_of_unsafe_threaded_function; }
int strtok(void) { return use_of_unsafe_threaded_function; }
int tmpnam(void) { return use_of_unsafe_threaded_function; }
EOF


Mime
View raw message