From d308352dbd4121d12d4f44d591463468c09d37f9 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 15 Sep 2013 23:00:01 -0400 Subject: Always use builtin JThread library --- src/CMakeLists.txt | 12 ++---------- src/ban.cpp | 2 +- src/ban.h | 4 ++-- src/client.cpp | 2 +- src/client.h | 2 +- src/debug.cpp | 4 ++-- src/jthread/CMakeLists.txt | 21 ++++++++------------- src/jthread/jthread.h | 2 +- src/jthread/pthread/jmutex.cpp | 2 +- src/jthread/pthread/jthread.cpp | 2 +- src/jthread/win32/jmutex.cpp | 2 +- src/jthread/win32/jthread.cpp | 2 +- src/profiler.h | 4 ++-- src/quicktune.cpp | 4 ++-- src/script/cpp_api/s_base.h | 4 ++-- src/server.cpp | 2 +- src/settings.h | 4 ++-- src/threads.h | 2 +- src/util/container.h | 4 ++-- src/util/thread.h | 6 +++--- 20 files changed, 37 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a46a823f..937dfab8f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_minimum_required( VERSION 2.6 ) # Set some random things default to not being visible in the GUI mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH) -mark_as_advanced(JTHREAD_INCLUDE_DIR JTHREAD_LIBRARY) mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) mark_as_advanced(JSON_INCLUDE_DIR JSON_LIBRARY) @@ -169,7 +168,6 @@ else() set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY}) endif() -find_package(Jthread REQUIRED) find_package(Sqlite3 REQUIRED) find_package(Json REQUIRED) find_package(OpenGLES2) @@ -225,6 +223,7 @@ configure_file( "${PROJECT_BINARY_DIR}/cmake_config.h" ) +add_subdirectory(jthread) add_subdirectory(script) add_subdirectory(util) @@ -294,6 +293,7 @@ set(common_SRCS serverlist.cpp pathfinder.cpp convert_json.cpp + ${JTHREAD_SRCS} ${common_SCRIPT_SRCS} ${UTIL_SRCS} ) @@ -381,7 +381,6 @@ include_directories( ${PNG_INCLUDE_DIR} ${GETTEXT_INCLUDE_DIR} ${SOUND_INCLUDE_DIRS} - ${JTHREAD_INCLUDE_DIR} ${SQLITE3_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${JSON_INCLUDE_DIR} @@ -416,7 +415,6 @@ if(BUILD_CLIENT) ${X11_LIBRARIES} ${GETTEXT_LIBRARY} ${SOUND_LIBRARIES} - ${JTHREAD_LIBRARY} ${SQLITE3_LIBRARY} ${LUA_LIBRARY} ${JSON_LIBRARY} @@ -447,7 +445,6 @@ if(BUILD_SERVER) target_link_libraries( ${PROJECT_NAME}server ${ZLIB_LIBRARIES} - ${JTHREAD_LIBRARY} ${SQLITE3_LIBRARY} ${JSON_LIBRARY} ${GETTEXT_LIBRARY} @@ -622,11 +619,6 @@ endif(USE_GETTEXT) # Subdirectories -if (JTHREAD_FOUND) -else (JTHREAD_FOUND) - add_subdirectory(jthread) -endif (JTHREAD_FOUND) - if (SQLITE3_FOUND) else (SQLITE3_FOUND) add_subdirectory(sqlite) diff --git a/src/ban.cpp b/src/ban.cpp index 5bb470a67..50ba0dba1 100644 --- a/src/ban.cpp +++ b/src/ban.cpp @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "ban.h" #include -#include +#include "jthread/jmutexautolock.h" #include #include #include "strfnd.h" diff --git a/src/ban.h b/src/ban.h index 529635c26..02a472f51 100644 --- a/src/ban.h +++ b/src/ban.h @@ -22,8 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include -#include -#include +#include "jthread/jthread.h" +#include "jthread/jmutex.h" #include "exceptions.h" class BanManager diff --git a/src/client.cpp b/src/client.cpp index 063dc4158..98c9af972 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client.h" #include #include "clientserver.h" -#include "jmutexautolock.h" +#include "jthread/jmutexautolock.h" #include "main.h" #include #include "filesys.h" diff --git a/src/client.h b/src/client.h index 9146941e8..9f5eb833b 100644 --- a/src/client.h +++ b/src/client.h @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "connection.h" #include "environment.h" #include "irrlichttypes_extrabloated.h" -#include "jmutex.h" +#include "jthread/jmutex.h" #include #include #include diff --git a/src/debug.cpp b/src/debug.cpp index 6bdd1bce5..b5bf3f705 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -25,8 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include -#include +#include "jthread/jmutex.h" +#include "jthread/jmutexautolock.h" /* Debug output diff --git a/src/jthread/CMakeLists.txt b/src/jthread/CMakeLists.txt index be38f87f3..aa438eaaf 100644 --- a/src/jthread/CMakeLists.txt +++ b/src/jthread/CMakeLists.txt @@ -1,16 +1,11 @@ if( UNIX ) - set(jthread_SRCS pthread/jmutex.cpp pthread/jthread.cpp) - set(jthread_platform_LIBS "") + set(JTHREAD_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jmutex.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pthread/jthread.cpp + PARENT_SCOPE) else( UNIX ) - set(jthread_SRCS win32/jmutex.cpp win32/jthread.cpp) - set(jthread_platform_LIBS "") + set(JTHREAD_SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/win32/jmutex.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/win32/jthread.cpp + PARENT_SCOPE) endif( UNIX ) - -add_library(jthread ${jthread_SRCS}) - -target_link_libraries( - jthread - ${jthread_platform_LIBS} -) - - diff --git a/src/jthread/jthread.h b/src/jthread/jthread.h index cd78231e9..ec1eafaeb 100644 --- a/src/jthread/jthread.h +++ b/src/jthread/jthread.h @@ -29,7 +29,7 @@ #define JTHREAD_H -#include "jmutex.h" +#include "jthread/jmutex.h" #define ERR_JTHREAD_CANTINITMUTEX -1 #define ERR_JTHREAD_CANTSTARTTHREAD -2 diff --git a/src/jthread/pthread/jmutex.cpp b/src/jthread/pthread/jmutex.cpp index 6bc3ae5e2..29e0baac0 100644 --- a/src/jthread/pthread/jmutex.cpp +++ b/src/jthread/pthread/jmutex.cpp @@ -25,7 +25,7 @@ */ -#include "jmutex.h" +#include "jthread/jmutex.h" JMutex::JMutex() { diff --git a/src/jthread/pthread/jthread.cpp b/src/jthread/pthread/jthread.cpp index 4a5c736eb..0ef250825 100644 --- a/src/jthread/pthread/jthread.cpp +++ b/src/jthread/pthread/jthread.cpp @@ -25,7 +25,7 @@ */ -#include "jthread.h" +#include "jthread/jthread.h" #include #include #include diff --git a/src/jthread/win32/jmutex.cpp b/src/jthread/win32/jmutex.cpp index 000461e3b..d079d448d 100644 --- a/src/jthread/win32/jmutex.cpp +++ b/src/jthread/win32/jmutex.cpp @@ -25,7 +25,7 @@ */ -#include "jmutex.h" +#include "jthread/jmutex.h" JMutex::JMutex() { diff --git a/src/jthread/win32/jthread.cpp b/src/jthread/win32/jthread.cpp index c07425dca..48b83b894 100644 --- a/src/jthread/win32/jthread.cpp +++ b/src/jthread/win32/jthread.cpp @@ -25,7 +25,7 @@ */ -#include "jthread.h" +#include "jthread/jthread.h" #ifndef _WIN32_WCE #include diff --git a/src/profiler.h b/src/profiler.h index e22a865c0..f674b3386 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -22,8 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irrlichttypes.h" #include -#include -#include +#include "jthread/jmutex.h" +#include "jthread/jmutexautolock.h" #include #include "util/timetaker.h" #include "util/numeric.h" // paging() diff --git a/src/quicktune.cpp b/src/quicktune.cpp index d3a7fcae2..6db72c727 100644 --- a/src/quicktune.cpp +++ b/src/quicktune.cpp @@ -18,8 +18,8 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "quicktune.h" -#include -#include +#include "jthread/jmutex.h" +#include "jthread/jmutexautolock.h" #include "util/string.h" std::string QuicktuneValue::getString() diff --git a/src/script/cpp_api/s_base.h b/src/script/cpp_api/s_base.h index 3cb59634b..63f7e423f 100644 --- a/src/script/cpp_api/s_base.h +++ b/src/script/cpp_api/s_base.h @@ -28,8 +28,8 @@ extern "C" { } #include "irrlichttypes.h" -#include "jmutex.h" -#include "jmutexautolock.h" +#include "jthread/jmutex.h" +#include "jthread/jmutexautolock.h" #include "common/c_types.h" #define SCRIPTAPI_LOCK_DEBUG diff --git a/src/server.cpp b/src/server.cpp index 3bdf9c23d..4df2162a7 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "ban.h" #include "environment.h" #include "map.h" -#include "jmutexautolock.h" +#include "jthread/jmutexautolock.h" #include "main.h" #include "constants.h" #include "voxel.h" diff --git a/src/settings.h b/src/settings.h index 62596f869..4ee5b5913 100644 --- a/src/settings.h +++ b/src/settings.h @@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irrlichttypes_bloated.h" #include "exceptions.h" #include -#include -#include +#include "jthread/jmutex.h" +#include "jthread/jmutexautolock.h" #include "strfnd.h" #include #include diff --git a/src/threads.h b/src/threads.h index 18789cf0c..503fa6abf 100644 --- a/src/threads.h +++ b/src/threads.h @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef THREADS_HEADER #define THREADS_HEADER -#include +#include "jthread/jmutex.h" #if (defined(WIN32) || defined(_WIN32_WCE)) typedef DWORD threadid_t; diff --git a/src/util/container.h b/src/util/container.h index d5854909a..89daa3fbc 100644 --- a/src/util/container.h +++ b/src/util/container.h @@ -22,8 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "../irrlichttypes.h" #include "../exceptions.h" -#include -#include +#include "../jthread/jmutex.h" +#include "../jthread/jmutexautolock.h" #include "../porting.h" // For sleep_ms #include #include diff --git a/src/util/thread.h b/src/util/thread.h index 6b2cf5b6c..678d9cf9b 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -21,9 +21,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #define UTIL_THREAD_HEADER #include "../irrlichttypes.h" -#include -#include -#include +#include "../jthread/jthread.h" +#include "../jthread/jmutex.h" +#include "../jthread/jmutexautolock.h" template class MutexedVariable -- cgit v1.2.3