summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authornfullagar@chromium.org <nfullagar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-08 00:46:05 +0000
committernfullagar@chromium.org <nfullagar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-08 00:46:05 +0000
commit030a9fb454f53b8a94567fe56eb524b735a04a4a (patch)
treeea92f89e813a8e48e37f6ea4a3b4091eb994ce98 /native_client_sdk
parent9221f6290a2c9e2b9b8044c5ea64747b035dfce0 (diff)
downloadchromium_src-030a9fb454f53b8a94567fe56eb524b735a04a4a.zip
chromium_src-030a9fb454f53b8a94567fe56eb524b735a04a4a.tar.gz
chromium_src-030a9fb454f53b8a94567fe56eb524b735a04a4a.tar.bz2
Move thread_pool.h into utils so it can be shared by more than one example.
BUG=none TEST=voronoi demo R=binji@chromium.org, noelallen@chromium.org Review URL: https://codereview.chromium.org/16325024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/build_tools/sdk_files.list32
-rw-r--r--native_client_sdk/src/examples/demo/voronoi/example.dsc6
-rw-r--r--native_client_sdk/src/examples/demo/voronoi/voronoi.cc2
-rw-r--r--native_client_sdk/src/libraries/error_handling/error_handling.h5
-rw-r--r--native_client_sdk/src/libraries/nacl_io/inode_pool.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_handle.h4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_intercept.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_object.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_wrap.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/library.dsc12
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount.cc7
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount.h4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_dev.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_http.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_mem.cc4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_html5fs.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/mount_node_mem.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/nacl_io.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/nacl_mounts.vcproj2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/osdirent.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/path.h2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/pepper_interface.h2
-rw-r--r--native_client_sdk/src/libraries/ppapi_simple/ps.h2
-rw-r--r--native_client_sdk/src/libraries/ppapi_simple/ps_event.h2
-rw-r--r--native_client_sdk/src/libraries/ppapi_simple/ps_instance.h2
-rw-r--r--native_client_sdk/src/libraries/sdk_util/auto_lock.h (renamed from native_client_sdk/src/libraries/utils/auto_lock.h)7
-rw-r--r--native_client_sdk/src/libraries/sdk_util/library.dsc29
-rw-r--r--native_client_sdk/src/libraries/sdk_util/macros.h (renamed from native_client_sdk/src/libraries/utils/macros.h)7
-rw-r--r--native_client_sdk/src/libraries/sdk_util/ref_object.h (renamed from native_client_sdk/src/libraries/utils/ref_object.h)7
-rw-r--r--native_client_sdk/src/libraries/sdk_util/thread_pool.cc (renamed from native_client_sdk/src/examples/demo/voronoi/threadpool.cc)4
-rw-r--r--native_client_sdk/src/libraries/sdk_util/thread_pool.h (renamed from native_client_sdk/src/examples/demo/voronoi/threadpool.h)6
-rw-r--r--native_client_sdk/src/libraries/sdk_util/thread_safe_queue.h (renamed from native_client_sdk/src/libraries/utils/thread_safe_queue.h)11
38 files changed, 119 insertions, 76 deletions
diff --git a/native_client_sdk/src/build_tools/sdk_files.list b/native_client_sdk/src/build_tools/sdk_files.list
index 61deb99..c733c9d 100644
--- a/native_client_sdk/src/build_tools/sdk_files.list
+++ b/native_client_sdk/src/build_tools/sdk_files.list
@@ -153,8 +153,6 @@ examples/demo/voronoi/index.html
examples/demo/voronoi/Makefile
[win]examples/demo/voronoi/make.bat
examples/demo/voronoi/manifest.json
-examples/demo/voronoi/threadpool.cc
-examples/demo/voronoi/threadpool.h
examples/demo/voronoi/voronoi.cc
examples/favicon.ico
[win]examples/getting_started/hello_world/make.bat
@@ -480,10 +478,11 @@ include/ppapi/utility/websocket/websocket_api.h
[win]include/win/pthread.h
[win]include/win/sched.h
[win]include/win/semaphore.h
-include/utils/auto_lock.h
-include/utils/macros.h
-include/utils/ref_object.h
-include/utils/thread_safe_queue.h
+include/sdk_util/auto_lock.h
+include/sdk_util/macros.h
+include/sdk_util/ref_object.h
+include/sdk_util/thread_safe_queue.h
+include/sdk_util/thread_pool.h
lib/glibc_x86_32/Debug/libjsoncpp.a
lib/glibc_x86_32/Debug/libjsoncpp.so
lib/glibc_x86_32/Debug/libnacl_io.a
@@ -496,6 +495,8 @@ lib/glibc_x86_32/Debug/libppapi_gles2.a
lib/glibc_x86_32/Debug/libppapi_gles2.so
lib/glibc_x86_32/Debug/libppapi_simple.a
lib/glibc_x86_32/Debug/libppapi_simple.so
+lib/glibc_x86_32/Debug/libsdk_util.a
+lib/glibc_x86_32/Debug/libsdk_util.so
lib/glibc_x86_32/Release/libjsoncpp.a
lib/glibc_x86_32/Release/libjsoncpp.so
lib/glibc_x86_32/Release/libnacl_io.a
@@ -508,6 +509,8 @@ lib/glibc_x86_32/Release/libppapi_gles2.a
lib/glibc_x86_32/Release/libppapi_gles2.so
lib/glibc_x86_32/Release/libppapi_simple.a
lib/glibc_x86_32/Release/libppapi_simple.so
+lib/glibc_x86_32/Release/libsdk_util.a
+lib/glibc_x86_32/Release/libsdk_util.so
lib/glibc_x86_64/Debug/libjsoncpp.a
lib/glibc_x86_64/Debug/libjsoncpp.so
lib/glibc_x86_64/Debug/libnacl_io.a
@@ -520,6 +523,8 @@ lib/glibc_x86_64/Debug/libppapi_gles2.a
lib/glibc_x86_64/Debug/libppapi_gles2.so
lib/glibc_x86_64/Debug/libppapi_simple.a
lib/glibc_x86_64/Debug/libppapi_simple.so
+lib/glibc_x86_64/Debug/libsdk_util.a
+lib/glibc_x86_64/Debug/libsdk_util.so
lib/glibc_x86_64/Release/libjsoncpp.a
lib/glibc_x86_64/Release/libjsoncpp.so
lib/glibc_x86_64/Release/libnacl_io.a
@@ -532,6 +537,8 @@ lib/glibc_x86_64/Release/libppapi_gles2.a
lib/glibc_x86_64/Release/libppapi_gles2.so
lib/glibc_x86_64/Release/libppapi_simple.a
lib/glibc_x86_64/Release/libppapi_simple.so
+lib/glibc_x86_64/Release/libsdk_util.a
+lib/glibc_x86_64/Release/libsdk_util.so
[linux]lib/${PLATFORM}_host/Debug/libjsoncpp.a
[linux]lib/${PLATFORM}_host/Debug/libppapi.a
[linux]lib/${PLATFORM}_host/Debug/libppapi_cpp.a
@@ -556,6 +563,8 @@ lib/glibc_x86_64/Release/libppapi_simple.so
[win]lib/${PLATFORM}_x86_32_host/Release/ppapi_gles2.lib
[win]lib/${PLATFORM}_x86_32_host/Release/ppapi.lib
[win]lib/${PLATFORM}_x86_32_host/Release/pthread.lib
+[win]lib/${PLATFORM}_x86_32_host/Debug/sdk_util.lib
+[win]lib/${PLATFORM}_x86_32_host/Release/sdk_util.lib
lib/newlib_arm/Debug/liberror_handling.a
lib/newlib_arm/Debug/libjsoncpp.a
lib/newlib_arm/Debug/libnacl_io.a
@@ -563,6 +572,7 @@ lib/newlib_arm/Debug/libppapi_cpp.a
lib/newlib_arm/Debug/libppapi_cpp_private.a
lib/newlib_arm/Debug/libppapi_gles2.a
lib/newlib_arm/Debug/libppapi_simple.a
+lib/newlib_arm/Debug/libsdk_util.a
lib/newlib_arm/Release/liberror_handling.a
lib/newlib_arm/Release/libjsoncpp.a
lib/newlib_arm/Release/libnacl_io.a
@@ -570,6 +580,7 @@ lib/newlib_arm/Release/libppapi_cpp.a
lib/newlib_arm/Release/libppapi_cpp_private.a
lib/newlib_arm/Release/libppapi_gles2.a
lib/newlib_arm/Release/libppapi_simple.a
+lib/newlib_arm/Release/libsdk_util.a
lib/newlib_x86_32/Debug/liberror_handling.a
lib/newlib_x86_32/Debug/libjsoncpp.a
lib/newlib_x86_32/Debug/libnacl_io.a
@@ -577,6 +588,7 @@ lib/newlib_x86_32/Debug/libppapi_cpp.a
lib/newlib_x86_32/Debug/libppapi_cpp_private.a
lib/newlib_x86_32/Debug/libppapi_gles2.a
lib/newlib_x86_32/Debug/libppapi_simple.a
+lib/newlib_x86_32/Debug/libsdk_util.a
lib/newlib_x86_32/Release/liberror_handling.a
lib/newlib_x86_32/Release/libjsoncpp.a
lib/newlib_x86_32/Release/libnacl_io.a
@@ -584,6 +596,7 @@ lib/newlib_x86_32/Release/libppapi_cpp.a
lib/newlib_x86_32/Release/libppapi_cpp_private.a
lib/newlib_x86_32/Release/libppapi_gles2.a
lib/newlib_x86_32/Release/libppapi_simple.a
+lib/newlib_x86_32/Release/libsdk_util.a
lib/newlib_x86_64/Debug/liberror_handling.a
lib/newlib_x86_64/Debug/libjsoncpp.a
lib/newlib_x86_64/Debug/libnacl_io.a
@@ -591,6 +604,7 @@ lib/newlib_x86_64/Debug/libppapi_cpp.a
lib/newlib_x86_64/Debug/libppapi_cpp_private.a
lib/newlib_x86_64/Debug/libppapi_gles2.a
lib/newlib_x86_64/Debug/libppapi_simple.a
+lib/newlib_x86_64/Debug/libsdk_util.a
lib/newlib_x86_64/Release/liberror_handling.a
lib/newlib_x86_64/Release/libjsoncpp.a
lib/newlib_x86_64/Release/libnacl_io.a
@@ -598,18 +612,21 @@ lib/newlib_x86_64/Release/libppapi_cpp.a
lib/newlib_x86_64/Release/libppapi_cpp_private.a
lib/newlib_x86_64/Release/libppapi_gles2.a
lib/newlib_x86_64/Release/libppapi_simple.a
+lib/newlib_x86_64/Release/libsdk_util.a
lib/pnacl/Debug/libjsoncpp.a
lib/pnacl/Debug/libnacl_io.a
lib/pnacl/Debug/libppapi_cpp.a
lib/pnacl/Debug/libppapi_cpp_private.a
lib/pnacl/Debug/libppapi_gles2.a
lib/pnacl/Debug/libppapi_simple.a
+lib/pnacl/Debug/libsdk_util.a
lib/pnacl/Release/libjsoncpp.a
lib/pnacl/Release/libnacl_io.a
lib/pnacl/Release/libppapi_cpp.a
lib/pnacl/Release/libppapi_cpp_private.a
lib/pnacl/Release/libppapi_gles2.a
lib/pnacl/Release/libppapi_simple.a
+lib/pnacl/Release/libsdk_util.a
LICENSE
NOTICE
README
@@ -859,6 +876,9 @@ src/ppapi_cpp_private/x509_certificate_private.cc
[win]src/ppapi/make.bat
[win,linux]src/ppapi/Makefile
[win,linux]src/ppapi/ppapi_externs.c
+src/sdk_util/Makefile
+[win]src/sdk_util/make.bat
+src/sdk_util/thread_pool.cc
toolchain/${PLATFORM}_arm_newlib/arm-nacl/include/irt.h
toolchain/${PLATFORM}_arm_newlib/arm-nacl/include/irt_ppapi.h
toolchain/${PLATFORM}_arm_newlib/arm-nacl/include/nacl/dynamic_annotations.h
diff --git a/native_client_sdk/src/examples/demo/voronoi/example.dsc b/native_client_sdk/src/examples/demo/voronoi/example.dsc
index 810d4f9..d9fabce 100644
--- a/native_client_sdk/src/examples/demo/voronoi/example.dsc
+++ b/native_client_sdk/src/examples/demo/voronoi/example.dsc
@@ -5,12 +5,10 @@
'NAME' : 'voronoi',
'TYPE' : 'main',
'SOURCES' : [
- 'voronoi.cc',
- 'threadpool.cc',
- 'threadpool.h'
+ 'voronoi.cc'
],
- 'LIBS': ['ppapi_cpp', 'ppapi', 'pthread']
+ 'LIBS': ['sdk_util', 'ppapi_cpp', 'ppapi', 'pthread']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/demo/voronoi/voronoi.cc b/native_client_sdk/src/examples/demo/voronoi/voronoi.cc
index 23e6d3e..d4e1025 100644
--- a/native_client_sdk/src/examples/demo/voronoi/voronoi.cc
+++ b/native_client_sdk/src/examples/demo/voronoi/voronoi.cc
@@ -23,7 +23,7 @@
#include <algorithm>
#include <string>
-#include "threadpool.h"
+#include "sdk_util/thread_pool.h"
// Global properties used to setup Voronoi demo.
namespace {
diff --git a/native_client_sdk/src/libraries/error_handling/error_handling.h b/native_client_sdk/src/libraries/error_handling/error_handling.h
index 29b4aca..add76ce 100644
--- a/native_client_sdk/src/libraries/error_handling/error_handling.h
+++ b/native_client_sdk/src/libraries/error_handling/error_handling.h
@@ -8,7 +8,7 @@
#define ERROR_HANDLING_ERROR_HANDLING_H_
#include "error_handling/string_stream.h"
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
EXTERN_C_BEGIN
@@ -82,4 +82,5 @@ int EHUnwindFrame(EHFrame* frame);
EXTERN_C_END
-#endif // ERROR_HANDLING_ERROR_HANDLING_H_ \ No newline at end of file
+#endif // ERROR_HANDLING_ERROR_HANDLING_H_
+
diff --git a/native_client_sdk/src/libraries/nacl_io/inode_pool.h b/native_client_sdk/src/libraries/nacl_io/inode_pool.h
index 5624b1d..4c3f44b 100644
--- a/native_client_sdk/src/libraries/nacl_io/inode_pool.h
+++ b/native_client_sdk/src/libraries/nacl_io/inode_pool.h
@@ -11,7 +11,7 @@
#include "nacl_io/osstat.h"
#include "pthread.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
class INodePool {
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
index a047125..4695be3 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
@@ -8,8 +8,8 @@
#include <pthread.h>
#include "nacl_io/ostypes.h"
-#include "utils/macros.h"
-#include "utils/ref_object.h"
+#include "sdk_util/macros.h"
+#include "sdk_util/ref_object.h"
class Mount;
class MountNode;
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_intercept.h b/native_client_sdk/src/libraries/nacl_io/kernel_intercept.h
index b1bcf90d..c4b658d 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_intercept.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_intercept.h
@@ -8,7 +8,7 @@
#include <ppapi/c/ppb.h>
#include <ppapi/c/pp_instance.h>
#include "nacl_io/ostypes.h"
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
EXTERN_C_BEGIN
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_object.cc b/native_client_sdk/src/libraries/nacl_io/kernel_object.cc
index 5c26530..4841864 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_object.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_object.cc
@@ -17,7 +17,7 @@
#include "nacl_io/kernel_handle.h"
#include "nacl_io/mount.h"
#include "nacl_io/mount_node.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
KernelObject::KernelObject() {
pthread_mutex_init(&kernel_lock_, NULL);
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
index 6d996d3..b0c449f 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
@@ -25,8 +25,8 @@
#include "nacl_io/osstat.h"
#include "nacl_io/path.h"
#include "nacl_io/pepper_interface.h"
-#include "utils/auto_lock.h"
-#include "utils/ref_object.h"
+#include "sdk_util/auto_lock.h"
+#include "sdk_util/ref_object.h"
#ifndef MAXPATHLEN
#define MAXPATHLEN 256
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h b/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h
index 87dca82..322fe72 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h
@@ -7,7 +7,7 @@
#include <sys/types.h>
#include <stdlib.h>
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
#if defined(__GLIBC__)
#include <sys/cdefs.h>
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h
index 7d7dd41..c4ff5e0 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h
@@ -6,7 +6,7 @@
#define LIBRARIES_NACL_IO_KERNEL_WRAP_REAL_H_
#include "nacl_io/ostypes.h"
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
EXTERN_C_BEGIN
diff --git a/native_client_sdk/src/libraries/nacl_io/library.dsc b/native_client_sdk/src/libraries/nacl_io/library.dsc
index 3e6b074..612af7d 100644
--- a/native_client_sdk/src/libraries/nacl_io/library.dsc
+++ b/native_client_sdk/src/libraries/nacl_io/library.dsc
@@ -2,8 +2,7 @@
'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'SEARCH': [
'.',
- 'pepper',
- '../utils'
+ 'pepper'
],
'TARGETS': [
{
@@ -73,15 +72,6 @@
"undef_macros.h",
],
'DEST': 'include/nacl_io/pepper',
- },
- {
- 'FILES': [
- "auto_lock.h",
- "macros.h",
- "ref_object.h",
- "thread_safe_queue.h"
- ],
- 'DEST': 'include/utils',
}
],
'DEST': 'src',
diff --git a/native_client_sdk/src/libraries/nacl_io/mount.cc b/native_client_sdk/src/libraries/nacl_io/mount.cc
index 8b583db..f099aa8 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount.cc
@@ -13,8 +13,8 @@
#include "nacl_io/mount_node_mem.h"
#include "nacl_io/osstat.h"
#include "nacl_io/path.h"
-#include "utils/auto_lock.h"
-#include "utils/ref_object.h"
+#include "sdk_util/auto_lock.h"
+#include "sdk_util/ref_object.h"
#if defined(WIN32)
#include <windows.h>
@@ -62,4 +62,5 @@ void Mount::OnNodeCreated(MountNode* node) {
void Mount::OnNodeDestroyed(MountNode* node) {
if (node->stat_.st_ino) inode_pool_.Release(node->stat_.st_ino);
-} \ No newline at end of file
+}
+
diff --git a/native_client_sdk/src/libraries/nacl_io/mount.h b/native_client_sdk/src/libraries/nacl_io/mount.h
index 622dae0..abfe68f 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount.h
+++ b/native_client_sdk/src/libraries/nacl_io/mount.h
@@ -11,8 +11,8 @@
#include "nacl_io/inode_pool.h"
#include "nacl_io/mount_node.h"
#include "nacl_io/path.h"
-#include "utils/macros.h"
-#include "utils/ref_object.h"
+#include "sdk_util/macros.h"
+#include "sdk_util/ref_object.h"
class MountNode;
class PepperInterface;
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_dev.cc b/native_client_sdk/src/libraries/nacl_io/mount_dev.cc
index 83d2e55..9190a92 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_dev.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_dev.cc
@@ -14,7 +14,7 @@
#include "nacl_io/mount_node.h"
#include "nacl_io/mount_node_dir.h"
#include "nacl_io/pepper_interface.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
#if defined(__native_client__)
# include <irt.h>
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc b/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
index 9b995359..c49acae 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
@@ -12,7 +12,7 @@
#include <string.h>
#include <algorithm>
#include "nacl_io/mount_node_html5fs.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
namespace {
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_http.cc b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
index 9a6579e..9e6155f 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_http.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
@@ -16,7 +16,7 @@
#include <vector>
#include "nacl_io/mount_node_dir.h"
#include "nacl_io/osinttypes.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
#if defined(WIN32)
#define snprintf _snprintf
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_mem.cc b/native_client_sdk/src/libraries/nacl_io/mount_mem.cc
index fa3035c..541f58c 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_mem.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_mem.cc
@@ -14,8 +14,8 @@
#include "nacl_io/mount_node_mem.h"
#include "nacl_io/osstat.h"
#include "nacl_io/path.h"
-#include "utils/auto_lock.h"
-#include "utils/ref_object.h"
+#include "sdk_util/auto_lock.h"
+#include "sdk_util/ref_object.h"
// TODO(noelallen) : Grab/Redefine these in the kernel object once available.
#define USR_ID 1002
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node.cc b/native_client_sdk/src/libraries/nacl_io/mount_node.cc
index ff722b4..97dc799 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node.cc
@@ -13,7 +13,7 @@
#include "nacl_io/kernel_wrap_real.h"
#include "nacl_io/mount.h"
#include "nacl_io/osmman.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
static const int USR_ID = 1001;
static const int GRP_ID = 1002;
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node.h b/native_client_sdk/src/libraries/nacl_io/mount_node.h
index 36a937e..6837548 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node.h
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node.h
@@ -8,7 +8,7 @@
#include <string>
#include "nacl_io/osstat.h"
-#include "utils/ref_object.h"
+#include "sdk_util/ref_object.h"
struct dirent;
struct stat;
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc b/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc
index 7a33bfd..aa4b019 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc
@@ -9,8 +9,8 @@
#include "nacl_io/osdirent.h"
#include "nacl_io/osstat.h"
-#include "utils/macros.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
+#include "sdk_util/macros.h"
MountNodeDir::MountNodeDir(Mount* mount)
: MountNode(mount),
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_html5fs.cc b/native_client_sdk/src/libraries/nacl_io/mount_node_html5fs.cc
index ce32e08..63c6ab8 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_html5fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_html5fs.cc
@@ -17,7 +17,7 @@
#include "nacl_io/mount.h"
#include "nacl_io/osdirent.h"
#include "nacl_io/pepper_interface.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
namespace {
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_mem.cc b/native_client_sdk/src/libraries/nacl_io/mount_node_mem.cc
index 0fa82ba..13f0d21 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node_mem.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node_mem.cc
@@ -8,7 +8,7 @@
#include <string.h>
#include "nacl_io/osstat.h"
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
#define BLOCK_SIZE (1 << 16)
#define BLOCK_MASK (BLOCK_SIZE - 1)
diff --git a/native_client_sdk/src/libraries/nacl_io/nacl_io.h b/native_client_sdk/src/libraries/nacl_io/nacl_io.h
index f934353..b408bb9 100644
--- a/native_client_sdk/src/libraries/nacl_io/nacl_io.h
+++ b/native_client_sdk/src/libraries/nacl_io/nacl_io.h
@@ -9,7 +9,7 @@
#include <ppapi/c/ppb.h>
#include "nacl_io/kernel_wrap.h"
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
EXTERN_C_BEGIN
diff --git a/native_client_sdk/src/libraries/nacl_io/nacl_mounts.vcproj b/native_client_sdk/src/libraries/nacl_io/nacl_mounts.vcproj
index 875a16f..d57c84f 100644
--- a/native_client_sdk/src/libraries/nacl_io/nacl_mounts.vcproj
+++ b/native_client_sdk/src/libraries/nacl_io/nacl_mounts.vcproj
@@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../win;../utils"
+ AdditionalIncludeDirectories="../win;../sdk_util"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
diff --git a/native_client_sdk/src/libraries/nacl_io/osdirent.h b/native_client_sdk/src/libraries/nacl_io/osdirent.h
index 22dcd61..39a3b95 100644
--- a/native_client_sdk/src/libraries/nacl_io/osdirent.h
+++ b/native_client_sdk/src/libraries/nacl_io/osdirent.h
@@ -8,7 +8,7 @@
#if defined(WIN32)
#include <sys/types.h>
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
struct dirent {
_ino_t d_ino;
diff --git a/native_client_sdk/src/libraries/nacl_io/path.h b/native_client_sdk/src/libraries/nacl_io/path.h
index 7ac41f2..fcbaa33 100644
--- a/native_client_sdk/src/libraries/nacl_io/path.h
+++ b/native_client_sdk/src/libraries/nacl_io/path.h
@@ -8,7 +8,7 @@
#include <string>
#include <vector>
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
typedef std::vector<std::string> StringArray_t;
diff --git a/native_client_sdk/src/libraries/nacl_io/pepper_interface.h b/native_client_sdk/src/libraries/nacl_io/pepper_interface.h
index 512fd6f..31915a4 100644
--- a/native_client_sdk/src/libraries/nacl_io/pepper_interface.h
+++ b/native_client_sdk/src/libraries/nacl_io/pepper_interface.h
@@ -21,7 +21,7 @@
#include <ppapi/c/ppb_url_response_info.h>
#include <ppapi/c/ppb_var.h>
-#include <utils/macros.h>
+#include <sdk_util/macros.h>
// Note: To add a new interface:
//
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps.h b/native_client_sdk/src/libraries/ppapi_simple/ps.h
index 92655d0..1d7b254 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps.h
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps.h
@@ -6,7 +6,7 @@
#define PPAPI_SIMPLE_PS_H_
#include "ppapi/c/pp_instance.h"
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
EXTERN_C_BEGIN
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps_event.h b/native_client_sdk/src/libraries/ppapi_simple/ps_event.h
index 536ba87..563832c 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps_event.h
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps_event.h
@@ -10,7 +10,7 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_var.h"
-#include "utils/macros.h"
+#include "sdk_util/macros.h"
EXTERN_C_BEGIN
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps_instance.h b/native_client_sdk/src/libraries/ppapi_simple/ps_instance.h
index 246e8bc..d888dd7 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps_instance.h
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps_instance.h
@@ -23,7 +23,7 @@
#include "ppapi_simple/ps_event.h"
#include "ppapi_simple/ps_main.h"
-#include "utils/thread_safe_queue.h"
+#include "sdk_util/thread_safe_queue.h"
typedef std::map<std::string, std::string> PropertyMap_t;
diff --git a/native_client_sdk/src/libraries/utils/auto_lock.h b/native_client_sdk/src/libraries/sdk_util/auto_lock.h
index 19dd66f..88215d0 100644
--- a/native_client_sdk/src/libraries/utils/auto_lock.h
+++ b/native_client_sdk/src/libraries/sdk_util/auto_lock.h
@@ -3,8 +3,8 @@
* found in the LICENSE file.
*/
-#ifndef LIBRARIES_UTILS_AUTO_LOCK_H_
-#define LIBRARIES_UTILS_AUTO_LOCK_H_
+#ifndef LIBRARIES_SDK_UTIL_AUTO_LOCK_H_
+#define LIBRARIES_SDK_UTIL_AUTO_LOCK_H_
#include <pthread.h>
@@ -27,4 +27,5 @@ class AutoLock {
pthread_mutex_t* lock_;
};
-#endif // LIBRARIES_UTILS_AUTO_LOCK_H_
+#endif // LIBRARIES_SDK_UTIL_AUTO_LOCK_H_
+
diff --git a/native_client_sdk/src/libraries/sdk_util/library.dsc b/native_client_sdk/src/libraries/sdk_util/library.dsc
new file mode 100644
index 0000000..0491d98
--- /dev/null
+++ b/native_client_sdk/src/libraries/sdk_util/library.dsc
@@ -0,0 +1,29 @@
+{
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
+ 'SEARCH': [
+ '.'
+ ],
+ 'TARGETS': [
+ {
+ 'NAME' : 'sdk_util',
+ 'TYPE' : 'lib',
+ 'SOURCES' : [
+ 'thread_pool.cc'
+ ]
+ }
+ ],
+ 'HEADERS': [
+ {
+ 'FILES': [
+ 'auto_lock.h',
+ 'macros.h',
+ 'ref_object.h',
+ 'thread_pool.h',
+ 'thread_safe_queue.h'
+ ],
+ 'DEST': 'include/sdk_util',
+ }
+ ],
+ 'DEST': 'src',
+ 'NAME': 'sdk_util',
+}
diff --git a/native_client_sdk/src/libraries/utils/macros.h b/native_client_sdk/src/libraries/sdk_util/macros.h
index 718d83f..fd15dc3 100644
--- a/native_client_sdk/src/libraries/utils/macros.h
+++ b/native_client_sdk/src/libraries/sdk_util/macros.h
@@ -2,8 +2,8 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifndef LIBRARIES_UTILS_MACROS_H_
-#define LIBRARIES_UTILS_MACROS_H_
+#ifndef LIBRARIES_SDK_UTIL_MACROS_H_
+#define LIBRARIES_SDK_UTIL_MACROS_H_
/**
* A macro to disallow the evil copy constructor and operator= functions
@@ -46,4 +46,5 @@
force_link_##x = 1; \
}
-#endif /* LIBRARIES_UTILS_MACROS_H_ */
+#endif /* LIBRARIES_SDK_UTIL_MACROS_H_ */
+
diff --git a/native_client_sdk/src/libraries/utils/ref_object.h b/native_client_sdk/src/libraries/sdk_util/ref_object.h
index d3eb9f8..4e81f32 100644
--- a/native_client_sdk/src/libraries/utils/ref_object.h
+++ b/native_client_sdk/src/libraries/sdk_util/ref_object.h
@@ -3,8 +3,8 @@
* found in the LICENSE file.
*/
-#ifndef LIBRARIES_UTILS_REF_OBJECT
-#define LIBRARIES_UTILS_REF_OBJECT
+#ifndef LIBRARIES_SDK_UTIL_REF_OBJECT
+#define LIBRARIES_SDK_UTIL_REF_OBJECT
#include <stdlib.h>
#include "pthread.h"
@@ -45,4 +45,5 @@ class RefObject {
int ref_count_;
};
-#endif // LIBRARIES_UTILS_REF_OBJECT
+#endif // LIBRARIES_SDK_UTIL_REF_OBJECT
+
diff --git a/native_client_sdk/src/examples/demo/voronoi/threadpool.cc b/native_client_sdk/src/libraries/sdk_util/thread_pool.cc
index 4c403f3..e7d2e5c 100644
--- a/native_client_sdk/src/examples/demo/voronoi/threadpool.cc
+++ b/native_client_sdk/src/libraries/sdk_util/thread_pool.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "threadpool.h"
+#include "sdk_util/thread_pool.h"
#include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#include <stdlib.h>
-#include "utils/auto_lock.h"
+#include "sdk_util/auto_lock.h"
// Initializes mutex, semaphores and a pool of threads. If 0 is passed for
// num_threads, all work will be performed on the dispatch thread.
diff --git a/native_client_sdk/src/examples/demo/voronoi/threadpool.h b/native_client_sdk/src/libraries/sdk_util/thread_pool.h
index d459120..760b3f7 100644
--- a/native_client_sdk/src/examples/demo/voronoi/threadpool.h
+++ b/native_client_sdk/src/libraries/sdk_util/thread_pool.h
@@ -4,8 +4,8 @@
// Simple thread pool class
-#ifndef EXAMPLES_DEMO_VORONOI_THREADPOOL_H_
-#define EXAMPLES_DEMO_VORONOI_THREADPOOL_H_
+#ifndef LIBRARIES_SDK_UTIL_THREAD_POOL_H_
+#define LIBRARIES_SDK_UTIL_THREAD_POOL_H_
#include <pthread.h>
#include <semaphore.h>
@@ -41,5 +41,5 @@ class ThreadPool {
sem_t work_sem_;
sem_t done_sem_;
};
-#endif // EXAMPLES_DEMO_VORONOI_THREADPOOL_H_
+#endif // LIBRARIES_SDK_UTIL_THREAD_POOL_H_
diff --git a/native_client_sdk/src/libraries/utils/thread_safe_queue.h b/native_client_sdk/src/libraries/sdk_util/thread_safe_queue.h
index d35d504..545b7c4 100644
--- a/native_client_sdk/src/libraries/utils/thread_safe_queue.h
+++ b/native_client_sdk/src/libraries/sdk_util/thread_safe_queue.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef LIBRARIES_UTILS_THREAD_SAFE_QUEUE_H_
-#define LIBRARIES_UTILS_THREAD_SAFE_QUEUE_H_
+#ifndef LIBRARIES_SDK_UTIL_THREAD_SAFE_QUEUE_H_
+#define LIBRARIES_SDK_UTIL_THREAD_SAFE_QUEUE_H_
#include <pthread.h>
#include <list>
-#include "utils/auto_lock.h"
-#include "utils/macros.h"
+#include "sdk_util/auto_lock.h"
+#include "sdk_util/macros.h"
// ThreadSafeQueue
@@ -59,4 +59,5 @@ template<class T> class ThreadSafeQueue {
DISALLOW_COPY_AND_ASSIGN(ThreadSafeQueue);
};
-#endif // LIBRARIES_UTILS_THREAD_SAFE_QUEUE_H_ \ No newline at end of file
+#endif // LIBRARIES_SDK_UTIL_THREAD_SAFE_QUEUE_H_
+