]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-255
authorRaymond Chandler <intralanman@freeswitch.org>
Mon, 15 Dec 2008 20:12:26 +0000 (20:12 +0000)
committerRaymond Chandler <intralanman@freeswitch.org>
Mon, 15 Dec 2008 20:12:26 +0000 (20:12 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10783 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_apr.h
src/switch_apr.c

index 94fb61d5f9e1f5be5a42c7b70312bf66c32c0eb8..a0a2dffc316a7336c8bd98e5b041a03d86945c27 100644 (file)
@@ -1305,6 +1305,44 @@ SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **po
 SWITCH_DECLARE(switch_status_t) switch_match_glob(const char *pattern, switch_array_header_t **result, switch_memory_pool_t *p);
 SWITCH_DECLARE(switch_status_t) switch_socket_addr_get(switch_sockaddr_t **sa, switch_bool_t remote, switch_socket_t *sock);
 
+/**
+ * Create an anonymous pipe.
+ * @param in The file descriptor to use as input to the pipe.
+ * @param out The file descriptor to use as output from the pipe.
+ * @param pool The pool to operate on.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_pipe_create(switch_file_t **in, switch_file_t **out, switch_memory_pool_t *p);
+
+/**
+ * Get the timeout value for a pipe or manipulate the blocking state.
+ * @param thepipe The pipe we are getting a timeout for.
+ * @param timeout The current timeout value in microseconds. 
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_get(switch_file_t *thepipe, switch_interval_time_t *timeout);
+
+/**
+ * Set the timeout value for a pipe or manipulate the blocking state.
+ * @param thepipe The pipe we are setting a timeout on.
+ * @param timeout The timeout value in microseconds.  Values < 0 mean wait 
+ *        forever, 0 means do not wait at all.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_set(switch_file_t *thepipe, switch_interval_time_t timeout);
+
+
+/**
+ * stop the current thread
+ * @param thd The thread to stop
+ * @param retval The return value to pass back to any thread that cares
+ */
+SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_status_t retval);
+
+/**
+ * block until the desired thread stops executing.
+ * @param retval The return value from the dead thread.
+ * @param thd The thread to join
+ */
+SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd);
+
  /** @} */
 
 
index 54eae09eca3e3b21feea7ba8624a42f26b9ba089..104f50b59a35b32c57bd392f5a223773b6e375a4 100644 (file)
@@ -947,6 +947,61 @@ SWITCH_DECLARE(switch_status_t) switch_match_glob(const char *pattern, switch_ar
        return apr_match_glob(pattern, (apr_array_header_t **) result, p);
 }
 
+/**
+ * Create an anonymous pipe.
+ * @param in The file descriptor to use as input to the pipe.
+ * @param out The file descriptor to use as output from the pipe.
+ * @param pool The pool to operate on.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_pipe_create(switch_file_t **in, switch_file_t **out, switch_memory_pool_t *p)
+{
+    return apr_file_pipe_create ((apr_file_t **) in, (apr_file_t **) out, p);
+}
+
+/**
+ * Get the timeout value for a pipe or manipulate the blocking state.
+ * @param thepipe The pipe we are getting a timeout for.
+ * @param timeout The current timeout value in microseconds. 
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_get(switch_file_t *thepipe, switch_interval_time_t *timeout)
+{
+       return apr_file_pipe_timeout_get( (apr_file_t *)thepipe, (apr_interval_time_t *)timeout);
+}
+
+/**
+ * Set the timeout value for a pipe or manipulate the blocking state.
+ * @param thepipe The pipe we are setting a timeout on.
+ * @param timeout The timeout value in microseconds.  Values < 0 mean wait 
+ *        forever, 0 means do not wait at all.
+ */
+SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_set(switch_file_t *thepipe, switch_interval_time_t timeout)
+{
+       return apr_file_pipe_timeout_set( (apr_file_t *)thepipe, (apr_interval_time_t)timeout);
+}
+
+
+/**
+ * stop the current thread
+ * @param thd The thread to stop
+ * @param retval The return value to pass back to any thread that cares
+ */
+SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_status_t retval)
+{
+       return apr_thread_exit((apr_thread_t *)thd, retval);
+}
+
+/**
+ * block until the desired thread stops executing.
+ * @param retval The return value from the dead thread.
+ * @param thd The thread to join
+ */
+SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd)
+{
+       return apr_thread_join((apr_status_t *)retval, (apr_thread_t *)thd); 
+}
+
+
+
 /* For Emacs:
  * Local Variables:
  * mode:c