Nebula
Loading...
Searching...
No Matches
criticalsection.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
14#include "core/config.h"
15#if (__WIN32__)
17namespace Threading
18{
20{ };
21}
22#elif ( __OSX__ || __APPLE__ || __linux__ )
24namespace Threading
25{
27{ };
28}
29#else
30#error "Threading::CriticalSection not implemented on this platform!"
31#endif
32
33namespace Threading
34{
36{
39 {
40 this->section->Enter();
41 }
42
44 {
45 this->section->Leave();
46 this->section = nullptr;
47 }
48
50};
51
52}
53
54//------------------------------------------------------------------------------
55
Posix-implementation of critical section.
Definition posixcriticalsection.h:24
Critical section objects are used to protect a portion of code from parallel execution.
Win32-implementation of critical section.
Definition win32criticalsection.h:32
Nebula compiler specific defines and configuration.
The Jobs2 system provides a set of threads and a pool of jobs from which threads can pickup work.
Definition jobs2.h:16
Definition criticalsection.h:36
Threading::CriticalSection * section
Definition criticalsection.h:49
~CriticalScope()
Definition criticalsection.h:43
CriticalScope(Threading::CriticalSection *section)
Definition criticalsection.h:37