Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/threads-ffi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2016-02-01 03:14:04 +0300
committerSoumith Chintala <soumith@fb.com>2016-02-01 03:14:04 +0300
commita8611d070bf5de53cc432fb50a1a3c68b9b729bb (patch)
tree30c13877dc163f76a4a63aeaafe18907c51ad4e1
parentd37e0e196e2d930f61819ac54538990f6ebfcd58 (diff)
minor fixes for android
-rw-r--r--CMakeLists.txt4
-rw-r--r--lib/threads.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a583a6f..8ae8615 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,3 +41,7 @@ else()
message(FATAL_ERROR "no threading system (pthread or Win32) available")
endif()
endif()
+
+IF(LUALIB)
+ TARGET_LINK_LIBRARIES(threadsmain ${LUALIB})
+ENDIF()
diff --git a/lib/threads.c b/lib/threads.c
index fbb8d60..6d845c4 100644
--- a/lib/threads.c
+++ b/lib/threads.c
@@ -20,7 +20,11 @@ static int thread_new(lua_State *L)
luaL_error(L, "threads: out of memory");
memcpy(code_dup, code, len+1);
+#ifdef RTLD_NODELETE /* platforms like android dont seem to support this */
void* lib = dlopen("libthreadsmain.so", RTLD_LAZY|RTLD_LOCAL|RTLD_NODELETE);
+#else
+ void* lib = dlopen("libthreadsmain.so", RTLD_LAZY|RTLD_LOCAL);
+#endif
if (!lib) {
free(code_dup);
luaL_error(L, "threads: dlopen: %s", dlerror());