diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 13:23:58 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch) | |
tree | a27e497da7104dd0a64f98a04fa3067668735e91 /drivers/unix/thread_posix.cpp | |
parent | 710b34b70227becdc652b4ae027fe0ac47409642 (diff) |
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
Diffstat (limited to 'drivers/unix/thread_posix.cpp')
-rw-r--r-- | drivers/unix/thread_posix.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index c227aec6d6..dda1edc3c3 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -54,17 +54,14 @@ pthread_key_t ThreadPosix::thread_id_key = _create_thread_id_key(); Thread::ID ThreadPosix::next_thread_id = 0; Thread::ID ThreadPosix::get_id() const { - return id; } Thread *ThreadPosix::create_thread_posix() { - return memnew(ThreadPosix); } void *ThreadPosix::thread_callback(void *userdata) { - ThreadPosix *t = reinterpret_cast<ThreadPosix *>(userdata); t->id = atomic_increment(&next_thread_id); pthread_setspecific(thread_id_key, (void *)memnew(ID(t->id))); @@ -79,7 +76,6 @@ void *ThreadPosix::thread_callback(void *userdata) { } Thread *ThreadPosix::create_func_posix(ThreadCreateCallback p_callback, void *p_user, const Settings &) { - ThreadPosix *tr = memnew(ThreadPosix); tr->callback = p_callback; tr->user = p_user; @@ -92,7 +88,6 @@ Thread *ThreadPosix::create_func_posix(ThreadCreateCallback p_callback, void *p_ return tr; } Thread::ID ThreadPosix::get_thread_id_func_posix() { - void *value = pthread_getspecific(thread_id_key); if (value) @@ -103,7 +98,6 @@ Thread::ID ThreadPosix::get_thread_id_func_posix() { return new_id; } void ThreadPosix::wait_to_finish_func_posix(Thread *p_thread) { - ThreadPosix *tp = static_cast<ThreadPosix *>(p_thread); ERR_FAIL_COND(!tp); ERR_FAIL_COND(tp->pthread == 0); @@ -113,7 +107,6 @@ void ThreadPosix::wait_to_finish_func_posix(Thread *p_thread) { } Error ThreadPosix::set_name_func_posix(const String &p_name) { - #ifdef PTHREAD_NO_RENAME return ERR_UNAVAILABLE; @@ -142,7 +135,6 @@ Error ThreadPosix::set_name_func_posix(const String &p_name) { }; void ThreadPosix::make_default() { - create_func = create_func_posix; get_thread_id_func = get_thread_id_func_posix; wait_to_finish_func = wait_to_finish_func_posix; @@ -150,7 +142,6 @@ void ThreadPosix::make_default() { } ThreadPosix::ThreadPosix() { - pthread = 0; } |