diff -pru perl5.004_64/os2/os2.c perl5.004_64-thr/os2/os2.c
--- perl5.004_64/os2/os2.c	Fri Feb 27 10:23:16 1998
+++ perl5.004_64-thr/os2/os2.c	Sat Apr  4 00:01:26 1998
@@ -40,16 +40,16 @@ const char *pthreads_states[] = {
 
 typedef struct {
     void *status;
-    pthread_cond_t cond;
+    perl_cond cond;
     enum pthreads_state state;
 } thread_join_t;
 
 thread_join_t *thread_join_data;
 int thread_join_count;
-pthread_mutex_t start_thread_mutex;
+perl_mutex start_thread_mutex;
 
 int
-pthread_join(pthread_t tid, void **status)
+pthread_join(perl_os_thread tid, void **status)
 {
     MUTEX_LOCK(&start_thread_mutex);
     switch (thread_join_data[tid].state) {
@@ -117,7 +117,7 @@ pthread_startit(void *arg)
 }
 
 int
-pthread_create(pthread_t *tid, const pthread_attr_t *attr, 
+pthread_create(perl_os_thread *tid, const pthread_attr_t *attr, 
 	       void *(*start_routine)(void*), void *arg)
 {
     void *args[2];
@@ -134,7 +134,7 @@ pthread_create(pthread_t *tid, const pth
 }
 
 int 
-pthread_detach(pthread_t tid)
+pthread_detach(perl_os_thread tid)
 {
     MUTEX_LOCK(&start_thread_mutex);
     switch (thread_join_data[tid].state) {
@@ -157,7 +157,7 @@ pthread_detach(pthread_t tid)
 
 /* This is a very bastardized version: */
 int
-os2_cond_wait(pthread_cond_t *c, pthread_mutex_t *m)
+os2_cond_wait(perl_cond *c, perl_mutex *m)
 {						
     int rc;
     if ((rc = DosResetEventSem(*c,&na)) && (rc != ERROR_ALREADY_RESET))
@@ -881,6 +881,9 @@ mod2fname(sv)
 	}
 	avlen --;
     }
+#ifdef USE_THREADS
+    sum++;				/* Avoid conflict of DLLs in memory. */
+#endif 
     fname[pos] = 'A' + (sum % 26);
     fname[pos + 1] = 'A' + (sum / 26 % 26);
     fname[pos + 2] = '\0';
diff -pru perl5.004_64/os2/os2thread.h perl5.004_64-thr/os2/os2thread.h
--- perl5.004_64/os2/os2thread.h	Wed Dec 17 06:58:56 1997
+++ perl5.004_64-thr/os2/os2thread.h	Fri Apr  3 23:49:44 1998
@@ -1,10 +1,16 @@
 #include <sys/builtin.h>
 #include <sys/fmutex.h>
 #include <sys/rmutex.h>
-typedef int pthread_t;
-typedef _rmutex pthread_mutex_t;
-/*typedef HEV pthread_cond_t;*/
-typedef unsigned long pthread_cond_t;
-typedef int pthread_key_t;
+typedef int perl_os_thread;
+
+typedef _rmutex perl_mutex;
+
+/*typedef HEV perl_cond;*/	/* Will include os2.h into all C files.  */
+typedef unsigned long perl_cond;
+
+typedef int perl_key;
+
 typedef unsigned long pthread_attr_t;
 #define PTHREADS_INCLUDED
+#define pthread_attr_init(arg) 0
+#define pthread_attr_setdetachstate(arg1,arg2) 0
