source: trunk/include/helpers/threads.h@ 45

Last change on this file since 45 was 44, checked in by umoeller, 24 years ago

Misc. changes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1
2/*
3 *@@sourcefile threads.h:
4 * header file for treads.c. See remarks there.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 *
9 *@@include #define INCL_DOSPROCESS
10 *@@include #include <os2.h>
11 *@@include #include "threads.h"
12 */
13
14/*
15 * Copyright (C) 1997-2000 Ulrich M”ller.
16 * This file is part of the "XWorkplace helpers" source package.
17 * This is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published
19 * by the Free Software Foundation, in version 2 as it comes in the
20 * "COPYING" file of the XWorkplace main distribution.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 */
26
27#if __cplusplus
28extern "C" {
29#endif
30
31#ifndef THREADS_HEADER_INCLUDED
32 #define THREADS_HEADER_INCLUDED
33
34 #define THRF_PMMSGQUEUE 0x0001
35 #define THRF_WAIT 0x0002
36 #define THRF_TRANSIENT 0x0004
37
38 /*
39 *@@ THREADINFO:
40 * thread info structure passed to secondary threads.
41 */
42
43 typedef struct _THREADINFO
44 {
45 // data maintained by thr* functions
46 ULONG cbStruct;
47 void* pThreadFunc; // as passed to thrCreate, really a PTHREADFUNC
48 PBOOL pfRunning; // as passed to thrCreate
49 const char *pcszThreadName; // as passed to thrCreate
50 ULONG flFlags; // as passed to thrCreate
51 ULONG ulData; // as passed to thrCreate
52
53 TID tid;
54 ULONG hevRunning; // this is a HEV really
55
56 // data maintained by thr_fntGeneric
57 HAB hab; // for PM threads
58 HMQ hmq; // for PM threads
59 BOOL fExitComplete; // TRUE if thr_fntGeneric is exiting
60
61 // data to be maintained by application
62 BOOL fExit;
63 ULONG ulResult;
64 ULONG ulFuncInfo;
65 HWND hwndNotify;
66 } THREADINFO, *PTHREADINFO;
67
68 typedef void _Optlink THREADFUNC (PTHREADINFO);
69 typedef THREADFUNC *PTHREADFUNC;
70
71 ULONG thrCreate(PTHREADINFO pti,
72 PTHREADFUNC pfn,
73 PBOOL pfRunning,
74 const char *pcszThreadName,
75 ULONG flFlags,
76 ULONG ulData);
77
78 ULONG thrRunSync(HAB hab,
79 PTHREADFUNC pfn,
80 const char *pcszThreadName,
81 ULONG ulData);
82
83 PTHREADINFO thrListThreads(PULONG pcThreads);
84
85 BOOL thrFindThread(PTHREADINFO pti,
86 ULONG tid);
87
88 BOOL thrClose(PTHREADINFO pti);
89
90 BOOL thrWait(PTHREADINFO pti);
91
92 BOOL thrFree(PTHREADINFO pti);
93
94 BOOL thrKill(PTHREADINFO pti);
95
96 TID thrQueryID(const THREADINFO* pti);
97
98 ULONG thrQueryPriority(VOID);
99
100#endif
101
102#if __cplusplus
103}
104#endif
105
Note: See TracBrowser for help on using the repository browser.