home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / src / md / unix / sunos4.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.0 KB  |  78 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 <setjmp.h>
  20. #include "primpl.h"
  21.  
  22. void _MD_EarlyInit(void)
  23. {
  24. }
  25.  
  26. PRStatus _MD_CREATE_THREAD(PRThread *thread, 
  27.                     void (*start)(void *), 
  28.                     PRThreadPriority priority,
  29.                     PRThreadScope scope, 
  30.                     PRThreadState state, 
  31.                     PRUint32 stackSize) 
  32. {
  33.     PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for SunOS 4.1.3.");
  34.     return PR_FAILURE;
  35. }
  36.  
  37. void _MD_SET_PRIORITY(_MDThread *md_thread, PRUintn newPri)
  38. {
  39.     PR_NOT_REACHED("_MD_SET_PRIORITY should not be called for user-level threads.");
  40. }
  41.  
  42. PRStatus
  43. _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
  44. {
  45.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  46.     _PR_MD_SWITCH_CONTEXT(thread);
  47.     return PR_SUCCESS;
  48. }
  49.  
  50. PRStatus
  51. _MD_WAKEUP_WAITER(PRThread *thread)
  52. {
  53.     if (thread) {
  54.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  55.     }
  56.     return PR_SUCCESS;
  57. }
  58.  
  59. PRStatus _MD_InitializeThread(PRThread *thread)
  60. {
  61.     return PR_SUCCESS;
  62. }
  63.  
  64. void
  65. _MD_YIELD(void)
  66. {
  67.     PR_NOT_REACHED("_MD_YIELD should not be called for SunOS 4.1.3.");
  68. }
  69.  
  70. PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
  71. {
  72.     if (isCurrent) {
  73.     (void) setjmp(CONTEXT(t));
  74.     }
  75.     *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
  76.     return (PRWord *) CONTEXT(t);
  77. }
  78.