Iros
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/container/allocator/forward_declaration.h
"
4
#include "
di/sync/dumb_spinlock.h
"
5
#include "
di/vocab/error/result.h
"
6
#include "
di/vocab/error/status_code_forward_declaration.h
"
7
#include "
dius/error.h
"
8
9
#ifndef DIUS_USE_RUNTIME
10
#include <mutex>
11
#include <pthread.h>
12
#endif
13
14
namespace
di::sync
{
15
class
DumbSpinlock
;
16
}
17
18
namespace
di::platform
{
19
#ifndef DIUS_USE_RUNTIME
20
using
ThreadId
= pthread_t;
21
22
using
DefaultLock
= std::mutex;
23
24
inline
auto
get_current_thread_id
() ->
ThreadId
{
25
return
pthread_self();
26
}
27
#else
28
using
ThreadId
=
i32
;
29
30
auto
get_current_thread_id
() ->
ThreadId
;
31
32
using
DefaultLock
= sync::DumbSpinlock;
33
#endif
34
35
using
DefaultAllocator
= container::InfallibleAllocator;
36
using
DefaultFallibleAllocator
= container::FallibleAllocator;
37
}
di::sync::DumbSpinlock
Definition
dumb_spinlock.h:13
forward_declaration.h
dumb_spinlock.h
error.h
di::platform
Definition
custom.h:30
di::platform::DefaultFallibleAllocator
container::FallibleAllocator DefaultFallibleAllocator
Definition
custom.h:40
di::platform::DefaultLock
std::mutex DefaultLock
Definition
custom.h:37
di::platform::DefaultAllocator
container::InfallibleAllocator DefaultAllocator
Definition
custom.h:39
di::platform::get_current_thread_id
auto get_current_thread_id() -> ThreadId
Definition
custom.h:33
di::platform::ThreadId
std::thread::id ThreadId
Definition
custom.h:31
di::sync
Definition
atomic.h:12
di::types::i32
__INT32_TYPE__ i32
Definition
integers.h:16
result.h
status_code_forward_declaration.h
libs
dius
include
dius
platform.h
Generated by
1.13.0