You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
@@ -34,19 +34,19 @@
|
||||
|
||||
Error SemaphoreWindows::wait() {
|
||||
|
||||
WaitForSingleObjectEx(semaphore,INFINITE, false);
|
||||
WaitForSingleObjectEx(semaphore, INFINITE, false);
|
||||
return OK;
|
||||
}
|
||||
Error SemaphoreWindows::post() {
|
||||
|
||||
ReleaseSemaphore(semaphore,1,NULL);
|
||||
ReleaseSemaphore(semaphore, 1, NULL);
|
||||
return OK;
|
||||
}
|
||||
int SemaphoreWindows::get() const {
|
||||
long previous;
|
||||
switch (WaitForSingleObjectEx(semaphore, 0, false)) {
|
||||
case WAIT_OBJECT_0: {
|
||||
ERR_FAIL_COND_V(!ReleaseSemaphore(semaphore, 1, &previous),-1);
|
||||
ERR_FAIL_COND_V(!ReleaseSemaphore(semaphore, 1, &previous), -1);
|
||||
return previous + 1;
|
||||
} break;
|
||||
case WAIT_TIMEOUT: {
|
||||
@@ -58,41 +58,38 @@ int SemaphoreWindows::get() const {
|
||||
ERR_FAIL_V(-1);
|
||||
}
|
||||
|
||||
|
||||
Semaphore *SemaphoreWindows::create_semaphore_windows() {
|
||||
|
||||
return memnew( SemaphoreWindows );
|
||||
return memnew(SemaphoreWindows);
|
||||
}
|
||||
|
||||
void SemaphoreWindows::make_default() {
|
||||
|
||||
create_func=create_semaphore_windows;
|
||||
create_func = create_semaphore_windows;
|
||||
}
|
||||
|
||||
SemaphoreWindows::SemaphoreWindows() {
|
||||
|
||||
#ifdef WINRT_ENABLED
|
||||
semaphore=CreateSemaphoreEx(
|
||||
NULL,
|
||||
0,
|
||||
0xFFFFFFF, //wathever
|
||||
NULL,
|
||||
0,
|
||||
SEMAPHORE_ALL_ACCESS);
|
||||
semaphore = CreateSemaphoreEx(
|
||||
NULL,
|
||||
0,
|
||||
0xFFFFFFF, //wathever
|
||||
NULL,
|
||||
0,
|
||||
SEMAPHORE_ALL_ACCESS);
|
||||
#else
|
||||
semaphore=CreateSemaphore(
|
||||
NULL,
|
||||
0,
|
||||
0xFFFFFFF, //wathever
|
||||
NULL);
|
||||
semaphore = CreateSemaphore(
|
||||
NULL,
|
||||
0,
|
||||
0xFFFFFFF, //wathever
|
||||
NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
SemaphoreWindows::~SemaphoreWindows() {
|
||||
|
||||
CloseHandle(semaphore);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user