source: trunk/src/kernel32/async.cpp@ 7549

Last change on this file since 7549 was 7549, checked in by sandervl, 24 years ago

preliminary changes for new overlapped io framework

File size: 2.9 KB
Line 
1/* $Id: async.cpp,v 1.11 2001-12-05 14:15:56 sandervl Exp $ */
2
3/*
4 * Win32 Asynchronous I/O Subsystem for OS/2
5 *
6 * 1998/04/10 PH Patrick Haller (haller@zebra.fh-weingarten.de)
7 *
8 * @(#) Async.Cpp 1.0.0 1998/04/10 PH start
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13
14
15/*****************************************************************************
16 * Remark *
17 *****************************************************************************
18
19 */
20
21
22
23/*****************************************************************************
24 * Includes *
25 *****************************************************************************/
26
27#define INCL_WIN
28#define INCL_DOSMEMMGR
29#define INCL_DOSSEMAPHORES
30#define INCL_DOSERRORS
31#define INCL_DOSPROCESS
32#define INCL_DOSMODULEMGR
33#define INCL_VIO
34#define INCL_AVIO
35#include <os2wrap.h> //Odin32 OS/2 api wrappers
36
37#include <stdlib.h>
38#include <string.h>
39#include "win32type.h"
40#include "misc.h"
41#include "unicode.h"
42
43#include "conwin.h" // Windows Header for console only
44#include "handlemanager.h"
45
46#define DBG_LOCALLOG DBG_async
47#include "dbglocal.h"
48
49
50/*****************************************************************************
51 * Defines & Macros *
52 *****************************************************************************/
53
54
55/*****************************************************************************
56 * Structures *
57 *****************************************************************************/
58
59typedef struct _IORequest
60{
61 struct _IORequest *pNext; /* pointer to next I/O request */
62
63 APIRET rc; /* result code of I/O request */
64
65} IOREQUEST, *PIOREQUEST;
66
67
68typedef struct _Globals
69{
70 HEV hevIOEvent; /* asynchronous I/O event completed ! */
71 TID tidIO; /* I/O thread */
72} GLOBALS, *PGLOBALS;
73
74static GLOBALS Globals;
75
76
77/*****************************************************************************
78 * Name :
79 * Purpose :
80 * Parameters:
81 * Variables :
82 * Result :
83 * Remark :
84 * Status :
85 *
86 * Author : Patrick Haller [Tue, 1998/02/10 01:55]
87 *****************************************************************************/
88
89DWORD WIN32API SleepEx(DWORD dwTimeout,
90 BOOL fAlertable)
91{
92
93 dprintf(("KERNEL32: SleepEx(%u,%u)\n",
94 dwTimeout,
95 fAlertable));
96
97 /* @@@PH could be implemented as a timed wait on a event semaphore */
98 /* for the WAIT_IO_COMPLETION flag */
99
100 if (fAlertable == FALSE)
101 DosSleep(dwTimeout);
102 else {
103 dprintf(("SleepEx: Wait for io completion not supported!"));
104 DosSleep(1);
105 }
106
107 return (0);
108}
109
Note: See TracBrowser for help on using the repository browser.