]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
added switch_file_lock and switch_file_unlock to the exposed functions from apr to...
authorMichael Jerris <mike@jerris.com>
Wed, 21 Feb 2007 18:39:10 +0000 (18:39 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 21 Feb 2007 18:39:10 +0000 (18:39 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4343 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_apr.h

index f0039a9d0bbafd9c416838ab9295b29fa7c794be..94157b46f69341f23fedf7ee52460f1ee47fca2b 100644 (file)
@@ -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)