From d90ca2f27069595843f80fb5fe67a9f30ad58760 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 21 Feb 2007 18:39:10 +0000 Subject: [PATCH] added switch_file_lock and switch_file_unlock to the exposed functions from apr to be used to make FSCORE-14 jira ticket cross platform. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4343 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_apr.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/include/switch_apr.h b/src/include/switch_apr.h index f0039a9d0b..94157b46f6 100644 --- a/src/include/switch_apr.h +++ b/src/include/switch_apr.h @@ -192,6 +192,25 @@ DoxyDefine(apr_status_t switch_file_open(switch_file_t **newf, const char *fname DoxyDefine(apr_status_t switch_file_close(switch_file_t *file);) #define switch_file_close apr_file_close +/** + * Establish a lock on the specified, open file. The lock may be advisory + * or mandatory, at the discretion of the platform. The lock applies to + * the file as a whole, rather than a specific range. Locks are established + * on a per-thread/process basis; a second lock by the same thread will not + * block. + * @param thefile The file to lock. + * @param type The type of lock to establish on the file. + */ +DoxyDefine(apr_status_t apr_file_lock(switch_file_t *thefile, int type);) +#define switch_file_lock apr_file_lock + +/** + * Remove any outstanding locks on the file. + * @param thefile The file to unlock. + */ +DoxyDefine(apr_status_t apr_file_unlock(switch_file_t *thefile);) +#define switch_file_unlock apr_file_unlock + /** * Delete the specified file. * @param path The full path to the file (using / on all systems)