- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
Latest commit
38 lines (26 loc) · 623 Bytes
/
Copy pathmain.cpp
File metadata and controls
38 lines (26 loc) · 623 Bytes
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
36
37
38
/**
* @file main.cpp
* @author d.deka (https://ddeka0.github.io/)
* @brief
* @version 0.1
* @date 2021-02-14
*
*/
#include<bits/stdc++.h>
#include"task_system.hpp"
#include"config.hpp"
#include"logger.hpp"
#include<chrono>
thread_local ThreadCtx* currContext[N];
longlong StackSize = 0x400000;
voidfunc() {
Log("TID before yield = ",THIS_THREAD_ID);
u_yield();
Log("TID After yield = ",THIS_THREAD_ID);
Log("Hello from func!");
}
intmain(int argc,char *argv[]) {
task_system ts;
ts.submit(func);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
}