You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +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:
@@ -36,10 +36,9 @@
|
||||
|
||||
Error SemaphorePosix::wait() {
|
||||
|
||||
|
||||
while(sem_wait(&sem)) {
|
||||
if (errno==EINTR) {
|
||||
errno=0;
|
||||
while (sem_wait(&sem)) {
|
||||
if (errno == EINTR) {
|
||||
errno = 0;
|
||||
continue;
|
||||
} else {
|
||||
perror("sem waiting");
|
||||
@@ -51,39 +50,36 @@ Error SemaphorePosix::wait() {
|
||||
|
||||
Error SemaphorePosix::post() {
|
||||
|
||||
return (sem_post(&sem)==0)?OK:ERR_BUSY;
|
||||
return (sem_post(&sem) == 0) ? OK : ERR_BUSY;
|
||||
}
|
||||
int SemaphorePosix::get() const {
|
||||
|
||||
int val;
|
||||
sem_getvalue(&sem, &val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
Semaphore *SemaphorePosix::create_semaphore_posix() {
|
||||
|
||||
return memnew( SemaphorePosix );
|
||||
return memnew(SemaphorePosix);
|
||||
}
|
||||
|
||||
void SemaphorePosix::make_default() {
|
||||
|
||||
create_func=create_semaphore_posix;
|
||||
create_func = create_semaphore_posix;
|
||||
}
|
||||
|
||||
SemaphorePosix::SemaphorePosix() {
|
||||
|
||||
int r = sem_init(&sem,0,0);
|
||||
int r = sem_init(&sem, 0, 0);
|
||||
if (r != 0)
|
||||
perror("sem creating");
|
||||
}
|
||||
|
||||
|
||||
SemaphorePosix::~SemaphorePosix() {
|
||||
|
||||
sem_destroy(&sem);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user