| Last change
 on this file since 7097 was             1678, checked in by bird, 26 years ago | 
        
          | 
Some bugsfixes - Yield is disabled.Added parameters.
 Correcte moduleheaders.
 Introduced a new base class for virtual lx modules + some elf sketches.
 
 | 
        
          | File size:
            1.3 KB | 
      
      
| Line |  | 
|---|
| 1 | /* $Id: yield.c,v 1.4 1999-11-10 01:45:37 bird Exp $ | 
|---|
| 2 | * | 
|---|
| 3 | * Yield - conversion may take some time. So it is necessary to | 
|---|
| 4 | *         check it's time to yield the processor to other processes. | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright (c) 1998-1999 knut st. osmundsen | 
|---|
| 7 | * | 
|---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 9 | * | 
|---|
| 10 | */ | 
|---|
| 11 |  | 
|---|
| 12 | /******************************************************************************* | 
|---|
| 13 | *   Defined Constants                                                          * | 
|---|
| 14 | *******************************************************************************/ | 
|---|
| 15 | #define INCL_DOSERRORS | 
|---|
| 16 | #define INCL_NOAPI | 
|---|
| 17 |  | 
|---|
| 18 | /******************************************************************************* | 
|---|
| 19 | *   Header Files                                                               * | 
|---|
| 20 | *******************************************************************************/ | 
|---|
| 21 | #include <os2.h> | 
|---|
| 22 |  | 
|---|
| 23 | #include "dev32.h" | 
|---|
| 24 | #include "dev32hlp.h" | 
|---|
| 25 | #include "yield.h" | 
|---|
| 26 |  | 
|---|
| 27 |  | 
|---|
| 28 | /** | 
|---|
| 29 | * Checks if we have to yield the CPU. Yield it if we must. | 
|---|
| 30 | */ | 
|---|
| 31 | BOOL Yield(void) | 
|---|
| 32 | { | 
|---|
| 33 | #if 0 /* Don't work on SMP and may cause trouble with logging at all machines... */ | 
|---|
| 34 | PBYTE  pfbYield; | 
|---|
| 35 |  | 
|---|
| 36 | pfbYield = D32Hlp_GetDOSVar(DHGETDOSV_YIELDFLAG, 0UL); | 
|---|
| 37 | if (pfbYield != NULL && *pfbYield) | 
|---|
| 38 | { | 
|---|
| 39 | D32Hlp_Yield(); | 
|---|
| 40 | return TRUE; | 
|---|
| 41 | } | 
|---|
| 42 | #endif | 
|---|
| 43 | return FALSE; | 
|---|
| 44 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.