forked from neosmart/pevents
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pevents.h
35 lines (29 loc) · 1.01 KB
/
pevents.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* WIN32 Events for POSIX
* Author: Mahmoud Al-Qudsi <[email protected]>
* Copyright (C) 2011 - 2012 by NeoSmart Technologies
* This code is released under the terms of the MIT License
*/
#pragma once
#include <pthread.h>
#include <stdint.h>
//Comment out the #define below to disable WFMO support if not used (recommended)
//Compiling with WFMO support will add some overhead to all event objects
#define WFMO 1
namespace neosmart
{
//Type declarations
struct neosmart_event_t_;
typedef neosmart_event_t_ * neosmart_event_t;
//WIN32-style functions
neosmart_event_t CreateEvent(bool manualReset = false, bool initialState = false);
int DestroyEvent(neosmart_event_t event);
int WaitForEvent(neosmart_event_t event, uint64_t milliseconds = -1);
int SetEvent(neosmart_event_t event);
int ResetEvent(neosmart_event_t event);
#ifdef WFMO
int WaitForMultipleEvents(neosmart_event_t *events, int count, bool waitAll, uint64_t milliseconds, int &index);
#endif
//POSIX-style functions
//TBD
}