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