summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2015-06-30 13:07:25 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2015-06-30 13:07:25 +0200
commit6d423246e5b09cedddd4bdeccfe5b716c0c64195 (patch)
tree1f224176a5bce6921c9124bcc8c095692f640f77 /ACE
parentd2b822928fdf919bad428a78cd680093f06bcd57 (diff)
parent64ee27f10bdffeb044559503039cc6bf1bc70fe2 (diff)
downloadATCD-6d423246e5b09cedddd4bdeccfe5b716c0c64195.tar.gz
Merge pull request #106 from jwillemsen/jwi-cpp11_processmanager-wait
Added support to use the wait operations of the ACE process manager u…
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ace/Process_Manager.h20
-rw-r--r--ACE/tests/Process_Manager_Test.cpp4
2 files changed, 24 insertions, 0 deletions
diff --git a/ACE/ace/Process_Manager.h b/ACE/ace/Process_Manager.h
index bd320c87f7b..d10f253298e 100644
--- a/ACE/ace/Process_Manager.h
+++ b/ACE/ace/Process_Manager.h
@@ -243,6 +243,15 @@ public:
* @retval 0 on success; -1 on failure.
*/
int wait (const ACE_Time_Value &timeout = ACE_Time_Value::max_time);
+#if defined (ACE_HAS_CPP11)
+ /// @sa wait
+ template< class Rep, class Period >
+ int wait (const std::chrono::duration<Rep, Period>& timeout)
+ {
+ ACE_Time_Value const tv (timeout);
+ return this->wait (tv);
+ }
+#endif
/**
* Wait up to @a timeout for a single specified process to terminate.
@@ -260,6 +269,17 @@ public:
pid_t wait (pid_t pid,
const ACE_Time_Value &timeout,
ACE_exitcode *status = 0);
+#if defined (ACE_HAS_CPP11)
+ /// @sa wait
+ template< class Rep, class Period >
+ pid_t wait (pid_t pid,
+ const std::chrono::duration<Rep, Period>& timeout,
+ ACE_exitcode *status = 0)
+ {
+ ACE_Time_Value const tv (timeout);
+ return this->wait (pid, tv, status);
+ }
+#endif
/**
* Wait indefinitely for a single, specified process to terminate.
diff --git a/ACE/tests/Process_Manager_Test.cpp b/ACE/tests/Process_Manager_Test.cpp
index 3d0f303fd2a..5c92805148c 100644
--- a/ACE/tests/Process_Manager_Test.cpp
+++ b/ACE/tests/Process_Manager_Test.cpp
@@ -437,7 +437,11 @@ run_main (int argc, ACE_TCHAR *argv[])
mgr,
1,
4);
+#if defined (ACE_HAS_CPP11)
+ result = mgr.wait (0, std::chrono::seconds (4), &exitcode);
+#else
result = mgr.wait (0, ACE_Time_Value (4), &exitcode);
+#endif
if (result != child4)
{