mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(thread): add CCritSect
This commit is contained in:
parent
368c2f16c2
commit
a500c34d45
4 changed files with 90 additions and 0 deletions
|
|
@ -6,6 +6,23 @@ uint32_t threadProc(void* param) {
|
|||
return 0;
|
||||
};
|
||||
|
||||
TEST_CASE("CCritSect::Enter", "[thread]") {
|
||||
SECTION("locks critical section") {
|
||||
CCritSect critSect;
|
||||
critSect.Enter();
|
||||
SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("CCritSect::Leave", "[thread]") {
|
||||
SECTION("unlocks critical section") {
|
||||
CCritSect critSect;
|
||||
critSect.Enter();
|
||||
critSect.Leave();
|
||||
SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("SGetCurrentThreadId", "[thread]") {
|
||||
SECTION("returns thread id") {
|
||||
uintptr_t threadId = SGetCurrentThreadId();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue