home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / src / md / unix / osf1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.1 KB  |  89 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "primpl.h"
  20.  
  21. void _MD_EarlyInit(void)
  22. {
  23. }
  24.  
  25. PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
  26. {
  27. #ifndef _PR_PTHREADS
  28.     if (isCurrent) {
  29.     (void) setjmp(CONTEXT(t));
  30.     }
  31.     *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
  32.     return (PRWord *) CONTEXT(t);
  33. #else
  34.     *np = 0;
  35.     return NULL;
  36. #endif
  37. }
  38.  
  39. #ifndef _PR_PTHREADS
  40. void
  41. _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
  42. {
  43.     return;
  44. }
  45.  
  46. PRStatus
  47. _MD_InitializeThread(PRThread *thread)
  48. {
  49.     return PR_SUCCESS;
  50. }
  51.  
  52. PRStatus
  53. _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
  54. {
  55.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  56.     _PR_MD_SWITCH_CONTEXT(thread);
  57.     return PR_SUCCESS;
  58. }
  59.  
  60. PRStatus
  61. _MD_WAKEUP_WAITER(PRThread *thread)
  62. {
  63.     if (thread) {
  64.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  65.     }
  66.     return PR_SUCCESS;
  67. }
  68.  
  69. /* These functions should not be called for OSF1 */
  70. void
  71. _MD_YIELD(void)
  72. {
  73.     PR_NOT_REACHED("_MD_YIELD should not be called for OSF1.");
  74. }
  75.  
  76. PRStatus
  77. _MD_CREATE_THREAD(
  78.     PRThread *thread,
  79.     void (*start) (void *),
  80.     PRThreadPriority priority,
  81.     PRThreadScope scope,
  82.     PRThreadState state,
  83.     PRUint32 stackSize)
  84. {
  85.     PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for OSF1.");
  86.     return PR_FAILURE;
  87. }
  88. #endif /* ! _PR_PTHREADS */
  89.