TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Cory Hill
from: Bob Liles
date: 1994-10-23 11:45:00
subject: Giving Up Slices

CH>Does anyone have any source (preferably Pascal, but ASM or C that I can 
CH>compile to an OBJ and link in Pascal is fine) to make a DOS application give 
CH>up time slices under OS/2 2.1?

Try this ASM code.  I assume you are using the 32 bit OS2.LIB library
and calling it from a 32 bit flat model program. Call it with the name
SLEEP and no arguments.
----------CUT HERE----------CUT HERE----------CUT HERE----------CUT HERE
.386

_text   segment dword   use32   public  'CODE'

assume  cs:_text,ds:_text,es:_text
extrn   dossleep:near

public  sleep
SLEEP   proc    near

push    1
call    dossleep
add     esp,4
ret

sleep   endp

_text   ends

end
----------CUT HERE----------CUT HERE----------CUT HERE----------CUT HERE

or this C code.  I tested this with Borland C++ for OS/2 v1.5.
----------CUT HERE----------CUT HERE----------CUT HERE----------CUT HERE
#define INCL_DOSPROCESS
#include 
void sleep(void)
{
        DosSleep(1L);
}
----------CUT HERE----------CUT HERE----------CUT HERE----------CUT HERE
These actually produce identical code at the assembly language level.
---
 * MR/2 2.0 #99 * Internet: XTJX59A{at}PRODIGY.COM   RIME: ->7   Prodigy: XTJX59A

--- QScan v1.131b / 01-0169

* Origin: The Party Line * Memphis * 901-755-4531 (1:123/5)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1
@PATH: 123/5 4 301 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.