aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 461f42d177..d1270348e0 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1299,3 +1299,15 @@ void RenameThread(const char* name)
(void)name;
#endif
}
+
+bool NewThread(void(*pfn)(void*), void* parg)
+{
+ try
+ {
+ boost::thread(pfn, parg); // thread detaches when out of scope
+ } catch(boost::thread_resource_error &e) {
+ printf("Error creating thread: %s\n", e.what());
+ return false;
+ }
+ return true;
+}