changes submitted by John Fairhurst (mjf35@cam.ac.uk) OS2_BRANCH
authordanda
Tue, 05 May 1998 20:48:41 +0000
branchOS2_BRANCH
changeset 91 9cfcc4308ae284d9cbb09b1f4206ab28ca9c3336
parent 90 36daa25a390b9e1cc130248b7d062894d91005bc
child 104 4f22cc04bc53afd528b8110fcf2826806d5f5c0d
push idunknown
push userunknown
push dateunknown
changes submitted by John Fairhurst (mjf35@cam.ac.uk) - now using _tzset() for VACPP - no longer calling _endthread() with EMX CVS: CVS:
pr/src/md/os2/os2thred.c
--- a/pr/src/md/os2/os2thred.c
+++ b/pr/src/md/os2/os2thred.c
@@ -14,16 +14,20 @@
  * Communications Corporation.  Portions created by Netscape are
  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  * Reserved.
  */
 
 #include "primpl.h"
 #include <process.h>  /* for _beginthread() */
 
+#ifdef XP_OS2_VACPP
+#include <time.h>     /* for _tzset() */
+#endif
+
 /* --- Declare these to avoid "implicit" warnings --- */
 PR_EXTERN(void) _PR_MD_NEW_SEM(_MDSemaphore *md, PRUintn value);
 PR_EXTERN(void) _PR_MD_DESTROY_SEM(_MDSemaphore *md);
 
 /* --- globals ------------------------------------------------ */
 _NSPR_TLS*        pThreadLocalStorage = 0;
 _PRInterruptTable             _pr_interruptTable[] = { { 0 } };
 APIRET (* APIENTRY QueryThreadContext)(TID, ULONG, PCONTEXTRECORD);
@@ -45,16 +49,20 @@ PR_IMPLEMENT(void)
 PR_IMPLEMENT(void)
 _PR_MD_EARLY_INIT()
 {
    HMODULE hmod;
 
    if (DosLoadModule(NULL, 0, "DOSCALL1.DLL", &hmod) == 0)
        DosQueryProcAddr(hmod, 877, "DOSQUERYTHREADCONTEXT",
                         (PFN *)&QueryThreadContext);
+
+#ifdef XP_OS2_VACPP
+   _tzset();
+#endif
 }
 
 PR_IMPLEMENT(void)
 _PR_MD_INIT_PRIMORDIAL_THREAD(PRThread *thread)
 {
    PTIB ptib;
    PPIB ppib;
    PRUword rc;
@@ -156,17 +164,19 @@ PR_IMPLEMENT(void)
         *
         * DosKillThread will not kill the current thread, instead we must use
         * DosExit.
         */
        if ( thread != _MD_CURRENT_THREAD() ) {
            DosKillThread( thread->md.handle );
            DosResumeThread( thread->md.handle );
        } else {
+#ifndef XP_OS2_EMX
            _endthread();
+#endif
        }
        thread->md.handle = 0;
     }
 
     _PR_MD_SET_CURRENT_THREAD(NULL);
 }