Main Page
Namespaces
Classes
Files
File List
File Members
platform
windows
libusb10emu
libusb-1.0
libusbemu_threads.h
Go to the documentation of this file.
1
/*
2
* This file is part of the OpenKinect Project. http://www.openkinect.org
3
*
4
* Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
5
* for details.
6
*
7
* This code is licensed to you under the terms of the Apache License, version
8
* 2.0, or, at your option, the terms of the GNU General Public License,
9
* version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10
* or the following URLs:
11
* http://www.apache.org/licenses/LICENSE-2.0
12
* http://www.gnu.org/licenses/gpl-2.0.txt
13
*
14
* If you redistribute this file in source form, modified or unmodified, you
15
* may:
16
* 1) Leave this header intact and distribute it under the same terms,
17
* accompanying it with the APACHE20 and GPL20 files, or
18
* 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19
* 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20
* In all cases you must keep the copyright notice intact and include a copy
21
* of the CONTRIB file.
22
*
23
* Binary distributions must follow the binary distribution requirements of
24
* either License.
25
*/
26
27
#pragma once
28
29
// Wrappers for platform-specific thread/synchronization objects:
30
// * Thread
31
// * Mutex (Critical Section)
32
// * Events (Conditional Variables)
33
34
#ifdef WIN32
35
// stick to the Windows scheme for now, but this structure could be easily
36
// replaced by pthread for portability; however if real-time priority turns
37
// out to be a requirement on that platform, the pthread implementation may
38
// not have support for such scheduling.
39
// for a much more lightweight run-time, this could be replaced by dummy
40
// objects, provided that the library client is careful enough to avoid any
41
// sort of race-conditions or dead-locks...
42
#include "
libusbemu_threads_win32.h
"
43
#else
44
#error LIBUSBEMU PTHREAD WRAPPER NOT YET IMPLEMENTED!
45
// #include "libusbemu_threads_pthread.h"
46
#endif
47
48
namespace
libusbemu
49
{
50
51
struct
RAIIMutex
52
{
53
QuickMutex
&
m_mutex
;
54
RAIIMutex
(
QuickMutex
& mutex) : m_mutex(mutex) { m_mutex.
Enter
(); }
55
~RAIIMutex
() { m_mutex.
Leave
(); }
56
};
57
58
}
libusbemu::RAIIMutex
Definition:
libusbemu_threads.h:51
libusbemu::RAIIMutex::~RAIIMutex
~RAIIMutex()
Definition:
libusbemu_threads.h:55
libusbemu::QuickMutex::Enter
void Enter()
Definition:
libusbemu_threads_win32.h:228
libusbemu::QuickMutex::Leave
void Leave()
Definition:
libusbemu_threads_win32.h:233
libusbemu_threads_win32.h
libusbemu::RAIIMutex::RAIIMutex
RAIIMutex(QuickMutex &mutex)
Definition:
libusbemu_threads.h:54
libusbemu
Definition:
failguard.cpp:6
libusbemu::QuickMutex
Definition:
libusbemu_threads_win32.h:207
libusbemu::RAIIMutex::m_mutex
QuickMutex & m_mutex
Definition:
libusbemu_threads.h:53
libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:42