From f8db8a3faa30b71dca33ced38be16d3f93f43e8a Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Sun, 19 Mar 2017 00:36:26 +0100 Subject: 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 5dbf1809c6e3e905b94b8764e99491e608122261. --- drivers/unix/mutex_posix.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'drivers/unix/mutex_posix.cpp') diff --git a/drivers/unix/mutex_posix.cpp b/drivers/unix/mutex_posix.cpp index c9b5bdce7..9009da206 100644 --- a/drivers/unix/mutex_posix.cpp +++ b/drivers/unix/mutex_posix.cpp @@ -34,7 +34,6 @@ void MutexPosix::lock() { pthread_mutex_lock(&mutex); - } void MutexPosix::unlock() { @@ -42,32 +41,30 @@ void MutexPosix::unlock() { } Error MutexPosix::try_lock() { - return (pthread_mutex_trylock(&mutex)==0)?OK:ERR_BUSY; + return (pthread_mutex_trylock(&mutex) == 0) ? OK : ERR_BUSY; } Mutex *MutexPosix::create_func_posix(bool p_recursive) { - return memnew( MutexPosix(p_recursive) ); + return memnew(MutexPosix(p_recursive)); } void MutexPosix::make_default() { - create_func=create_func_posix; + create_func = create_func_posix; } MutexPosix::MutexPosix(bool p_recursive) { - + pthread_mutexattr_init(&attr); if (p_recursive) - pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex,&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex, &attr); } - MutexPosix::~MutexPosix() { pthread_mutex_destroy(&mutex); } - #endif -- cgit v1.2.3-70-g09d2