summaryrefslogtreecommitdiff
path: root/src/components/utils/include/utils
diff options
context:
space:
mode:
authorJustin Dickow <jjdickow@gmail.com>2015-02-20 09:11:18 -0500
committerJustin Dickow <jjdickow@gmail.com>2015-02-20 09:11:18 -0500
commita7c5d752cb75485baa0ded5226335d0f8eb10321 (patch)
treefbfd9251ada2cdcd5cf6a03a79887d08f6b496d7 /src/components/utils/include/utils
parentb2b2233d866f102d3de339afa8ccaf37d3cf2570 (diff)
downloadsdl_core-a7c5d752cb75485baa0ded5226335d0f8eb10321.tar.gz
Bug Fixes and ImprovementsSynchronizationCommit
Fix Empty perform iteration request Fix type of name from string to enum SendLocation implemented on HTML5 HMI Fixed PI response on VR rejection due to high priority. Fix Apps not responsive/not able to start app/apps remain listed on SYNC even after USB disconnect Mobile API change and processing capabilities Change perform interaction request conditions. Fix SDL must always start 3sec timer before resuming the HMILevel of the app Remove redundant StartSavePersistentDataTimer() call. Change wrong predicate name to right. Added stream request handling feature Made streaming timeout in media manager configurable Put navi app in LIMITED in case of phone call Handling of audio state for applications Add stop streaming timeout into ini file Implement HMILevel resumption for job-1 Fix result code ABORTED when interrupts it by Voice recognition activation Fix incorrect value parameter unexpectedDisconnect in BCOnAppUnregistered Fix SDL send BC.OnAppUnregistered with "unexpectedDisconnect" set to "true" in case received from HMI OnExitAllApplications {"reason":"MASTER_RESET"} Fix Update ini file for iAP1 support Current working directory added to image path Fix helpers to make it workable with more then 2 parameters DCHECK() for ManageMobileCommand() replaced with log message because the latter returns false in some regular situations (e.g. TOO_MANY_PENDING_REQUESTS, see SDLAQ-CRS-10) Remove connection after closing. Signed-off-by: Justin Dickow <jjdickow@gmail.com>
Diffstat (limited to 'src/components/utils/include/utils')
-rw-r--r--src/components/utils/include/utils/back_trace.h6
-rw-r--r--src/components/utils/include/utils/bitstream.h2
-rw-r--r--src/components/utils/include/utils/file_system.h9
-rw-r--r--src/components/utils/include/utils/gen_hash.h50
-rw-r--r--src/components/utils/include/utils/helpers.h119
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h1
-rw-r--r--src/components/utils/include/utils/resource_usage.h13
-rw-r--r--src/components/utils/include/utils/signals.h72
-rw-r--r--src/components/utils/include/utils/singleton.h2
-rw-r--r--src/components/utils/include/utils/stl_utils.h27
-rw-r--r--src/components/utils/include/utils/system.h5
-rw-r--r--src/components/utils/include/utils/threads/pulse_thread_delegate.h4
-rw-r--r--src/components/utils/include/utils/threads/thread_validator.h11
13 files changed, 262 insertions, 59 deletions
diff --git a/src/components/utils/include/utils/back_trace.h b/src/components/utils/include/utils/back_trace.h
index 7f8912faf9..f2410e36bc 100644
--- a/src/components/utils/include/utils/back_trace.h
+++ b/src/components/utils/include/utils/back_trace.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -61,10 +61,10 @@ class Backtrace {
// Captured symbols in order from topmost stack frame to last captured
std::vector<std::string> CallStack() const;
- threads::Thread::Id ThreadId() const;
+ threads::PlatformThreadHandle ThreadId() const;
private:
- threads::Thread::Id thread_id_;
+ threads::PlatformThreadHandle thread_id_;
std::vector<void*> backtrace_;
};
diff --git a/src/components/utils/include/utils/bitstream.h b/src/components/utils/include/utils/bitstream.h
index cba15abd8b..9bf41d187f 100644
--- a/src/components/utils/include/utils/bitstream.h
+++ b/src/components/utils/include/utils/bitstream.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index d68ec484f9..7b69527606 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -234,6 +234,13 @@ const std::string ConvertPathForURL(const std::string& path);
*/
bool CreateFile(const std::string& path);
+/**
+ * @brief Get modification time of file
+ * @param path Path to file
+ * @return Modification time in nanoseconds
+ */
+uint64_t GetFileModificationTime(const std::string& path);
+
void remove_directory_content(const std::string& directory_name);
} // namespace file_system
diff --git a/src/components/utils/include/utils/gen_hash.h b/src/components/utils/include/utils/gen_hash.h
new file mode 100644
index 0000000000..e4102d36db
--- /dev/null
+++ b/src/components/utils/include/utils/gen_hash.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_GEN_HASH_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_GEN_HASH_H_
+
+#include <string>
+
+namespace utils {
+
+/**
+ * @brief generate random alphanumeric string of specified length
+ * @param size length of random string
+ * @return random string
+ */
+
+const std::string gen_hash(size_t size);
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_GEN_HASH_H_
diff --git a/src/components/utils/include/utils/helpers.h b/src/components/utils/include/utils/helpers.h
new file mode 100644
index 0000000000..e616dd56c1
--- /dev/null
+++ b/src/components/utils/include/utils/helpers.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
+
+/**
+ * These helpers allows to simplify compare strategy between some objects.
+ * Suppose user has some enum with value E with some numbers of possible values
+ * enum E {V1, V2, V3, V5};
+ * So we want to know if some user-input value is belong to one of the enum's subset.
+ * Usually user has to do next routine
+ *
+ * E input_value = V3;
+ * if (input_value == V1 || input_value == V2 || input_value == V3) {
+ * do_some_stuff_here;
+ * }
+ *
+ * How it suppose to be with these helpers methods:
+ *
+ * E input_value = V3;
+ * if (Compare<E, EQ, ONE>(input_value, V1, V2, V3)) {
+ * do_some_stuff;
+ * }
+ *
+ * Also User is able to easily change compare startegy by using some set of
+ * predefined startegies.
+ */
+namespace helpers {
+
+ template<typename T>
+ bool EQ (T what, T to) {
+ return what == to;
+ }
+
+ template<typename T>
+ bool NEQ (T what, T to) {
+ return !EQ<T>(what, to);
+ }
+
+ template<class U = bool>
+ bool ALL (U what, U to) {
+ return what && to;
+ }
+
+ template<class U = bool>
+ bool ONE (U what, U to) {
+ return what || to;
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool ,bool)>
+ bool Compare (T what, T to) {
+ return CompareType(what, to);
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to),
+ Compare<T, CompareType, CmpStrategy>(what, to1));
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1, T to2) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to, to1),
+ Compare<T, CompareType, CmpStrategy>(what, to2));
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1, T to2, T to3) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to, to1, to2),
+ Compare<T, CompareType, CmpStrategy>(what, to3));
+ }
+
+ template <typename T,
+ bool (*CompareType)(T ,T),
+ bool (*CmpStrategy)(bool, bool)>
+ bool Compare(T what, T to, T to1, T to2, T to3, T to4) {
+ return CmpStrategy(Compare<T, CompareType, CmpStrategy>(what, to, to1, to2, to3),
+ Compare<T, CompareType, CmpStrategy>(what, to4));
+ }
+}
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index b23a246e13..87b6c7e531 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -37,6 +37,7 @@
#include <queue>
#include <log4cxx/logger.h>
+#include "utils/macro.h"
#include "utils/threads/message_loop_thread.h"
#include "utils/singleton.h"
diff --git a/src/components/utils/include/utils/resource_usage.h b/src/components/utils/include/utils/resource_usage.h
index a8fa4aa7d9..ff90b2c22f 100644
--- a/src/components/utils/include/utils/resource_usage.h
+++ b/src/components/utils/include/utils/resource_usage.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -38,6 +38,7 @@
#include <sys/procfs.h>
#endif
+#include "utils/macro.h"
#include <string>
#include <iostream>
@@ -120,6 +121,16 @@ class Resources {
private:
+#ifdef BUILD_TESTS
+ friend class ResourceUsagePrivateTest;
+ FRIEND_TEST(ResourceUsagePrivateTest, ReadStatFileTest);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetProcInfoTest);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetMemInfoTest);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetStatPathTest_FileExists);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetStatPathTest_ReadFile);
+ FRIEND_TEST(ResourceUsagePrivateTest, GetProcPathTest);
+#endif
+
/*
* @brief reads /proc/PID/stat file on linux
* do not work on QNX ( return false, output wan't be changed )
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
index 28e8afd9d6..6c91836309 100644
--- a/src/components/utils/include/utils/signals.h
+++ b/src/components/utils/include/utils/signals.h
@@ -1,41 +1,49 @@
/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
+#ifdef __QNXNTO__
+typedef void (*sighandler_t) (int);
+#else
+#include <signal.h>
+#endif
+
namespace utils {
-bool SubscribeToTerminateSignal(void (*func)(int32_t p));
-bool ResetSubscribeToTerminateSignal();
+
+bool SubscribeToTerminateSignal(sighandler_t func);
+bool SubscribeToFaultSignal(sighandler_t func);
+
} // namespace utils
#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
diff --git a/src/components/utils/include/utils/singleton.h b/src/components/utils/include/utils/singleton.h
index d7b625e0a1..41face4f2f 100644
--- a/src/components/utils/include/utils/singleton.h
+++ b/src/components/utils/include/utils/singleton.h
@@ -28,7 +28,7 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
diff --git a/src/components/utils/include/utils/stl_utils.h b/src/components/utils/include/utils/stl_utils.h
index f525c6429f..70fbadbd5e 100644
--- a/src/components/utils/include/utils/stl_utils.h
+++ b/src/components/utils/include/utils/stl_utils.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2015, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,14 +44,15 @@ template<class T>
class StlCollectionDeleter {
public:
typedef T Collection;
- StlCollectionDeleter(T* collection): collection_(collection) {
+ StlCollectionDeleter(T* collection)
+ : collection_(collection) {
DCHECK(collection_);
}
~StlCollectionDeleter() {
- for (typename Collection::iterator i = collection_->begin(),
- end = collection_->end();
- i != end; ++i) {
+ for (typename Collection::iterator i = collection_->begin(), end =
+ collection_->end(); i != end; ++i) {
delete *i;
+ *i = NULL;
}
}
private:
@@ -62,20 +63,22 @@ template<class T>
class StlMapDeleter {
public:
typedef T Collection;
- StlMapDeleter(T* collection): collection_(collection) {
+ StlMapDeleter(T* collection)
+ : collection_(collection) {
DCHECK(collection_);
}
~StlMapDeleter() {
- for (typename Collection::iterator i = collection_->begin(),
- end = collection_->end();
- i != end; ++i) {
+ for (typename Collection::iterator i = collection_->begin(), end =
+ collection_->end(); i != end; ++i) {
delete i->second;
+ i->second = NULL;
}
+
}
private:
Collection* collection_;
};
-} // namespace utils
+} // namespace utils
-#endif /* SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_ */
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_
diff --git a/src/components/utils/include/utils/system.h b/src/components/utils/include/utils/system.h
index 16bdc03673..3b34d78526 100644
--- a/src/components/utils/include/utils/system.h
+++ b/src/components/utils/include/utils/system.h
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
@@ -76,6 +76,9 @@ class System {
*/
bool Execute(bool wait);
+ std::string command() const;
+ std::vector<std::string> argv() const;
+
private:
/**
* Command for executing
diff --git a/src/components/utils/include/utils/threads/pulse_thread_delegate.h b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
index bb109bde94..207b64caaf 100644
--- a/src/components/utils/include/utils/threads/pulse_thread_delegate.h
+++ b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
@@ -57,7 +57,7 @@ class PulseThreadDelegate : public ThreadDelegate {
*/
PulseThreadDelegate();
virtual void threadMain();
- virtual bool exitThreadMain();
+ virtual void exitThreadMain();
protected:
/**
@@ -86,7 +86,7 @@ class PulseThreadDelegate : public ThreadDelegate {
private:
enum {PULSE_CODE = _PULSE_CODE_MINAVAIL + 1};
- bool run_;
+ volatile bool run_;
int chid_;
int coid_;
};
diff --git a/src/components/utils/include/utils/threads/thread_validator.h b/src/components/utils/include/utils/threads/thread_validator.h
index def1994b76..dc2d138e2e 100644
--- a/src/components/utils/include/utils/threads/thread_validator.h
+++ b/src/components/utils/include/utils/threads/thread_validator.h
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
+/*
+ * Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,8 +67,9 @@ class SingleThreadSimpleValidator {
// This method should be called in every public method
// of classes being checked for absence of concurrent access
void AssertRunningOnCreationThread() const;
+ PlatformThreadHandle creation_thread_id() const;
private:
- const Thread::Id creation_thread_id_;
+ const PlatformThreadHandle creation_thread_id_;
};
@@ -91,13 +92,13 @@ class SingleThreadValidator {
// Must be called prior to transferring object being validated to
// another thread or when passing it back
- void PassToThread(Thread::Id thread_id) const;
+ void PassToThread(PlatformThreadHandle thread_id) const;
// This method should be called in every public method
// of classes being checked for absence of unintended concurrent
// access
void AssertRunningOnValidThread() const;
private:
- mutable Thread::Id owning_thread_id_;
+ mutable PlatformThreadHandle owning_thread_id_;
};
} // namespace threads