CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/vncdll/winvnc/omnithread/nt.h
Views: 11784
1
// Package : omnithread
2
// omnithread/nt.h Created : 6/95 tjr
3
//
4
// Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
5
//
6
// This file is part of the omnithread library
7
//
8
// The omnithread library is free software; you can redistribute it and/or
9
// modify it under the terms of the GNU Library General Public
10
// License as published by the Free Software Foundation; either
11
// version 2 of the License, or (at your option) any later version.
12
//
13
// This library is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
// Library General Public License for more details.
17
//
18
// You should have received a copy of the GNU Library General Public
19
// License along with this library; if not, write to the Free
20
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21
// 02111-1307, USA
22
//
23
//
24
// OMNI thread implementation classes for NT threads.
25
//
26
27
#ifndef __omnithread_nt_h_
28
#define __omnithread_nt_h_
29
30
#include <windows.h>
31
32
#define OMNI_THREAD_WRAPPER \
33
unsigned __stdcall omni_thread_wrapper(LPVOID ptr)
34
35
extern "C" OMNI_THREAD_WRAPPER;
36
37
#define OMNI_MUTEX_IMPLEMENTATION \
38
CRITICAL_SECTION crit;
39
40
#define OMNI_CONDITION_IMPLEMENTATION \
41
CRITICAL_SECTION crit; \
42
omni_thread* waiting_head; \
43
omni_thread* waiting_tail;
44
45
#define OMNI_SEMAPHORE_IMPLEMENTATION \
46
HANDLE nt_sem;
47
48
#define OMNI_THREAD_IMPLEMENTATION \
49
HANDLE handle; \
50
DWORD nt_id; \
51
void* return_val; \
52
HANDLE cond_semaphore; \
53
omni_thread* cond_next; \
54
omni_thread* cond_prev; \
55
BOOL cond_waiting; \
56
static int nt_priority(priority_t); \
57
friend class omni_condition; \
58
friend OMNI_THREAD_WRAPPER;
59
60
#endif
61
62