summaryrefslogtreecommitdiff
path: root/locks/os2
diff options
context:
space:
mode:
authorAaron Bannert <aaron@apache.org>2001-10-17 00:33:00 +0000
committerAaron Bannert <aaron@apache.org>2001-10-17 00:33:00 +0000
commit8067a836a081e31876053dd7e79d7dbba0f371ce (patch)
tree165cda9c95dc0432268a06e5530abc06fa1cf17d /locks/os2
parentef26b54cf0f34fe6e93115fff0f0f86558c2fe68 (diff)
downloadapr-8067a836a081e31876053dd7e79d7dbba0f371ce.tar.gz
Added a new parameter to apr_thread_mutex_init(). Mutexes are now by
default not nested, but an init flag can enable them. I added a new test to testlockperf to show how much faster non-nested mutexes are. I also updated calls to apr_thread_mutex_init() wherever I could find them. This patch only implements this for Unix (nested locks already existed on Unix, so this patch just optionally enables/disables them). I did my best to change the function declaration on other platforms, but someone will have to double check me. Those other platforms will also have to either enable nested locks (sometimes available in their thread library) or just do what Unix does. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks/os2')
-rw-r--r--locks/os2/thread_mutex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/locks/os2/thread_mutex.c b/locks/os2/thread_mutex.c
index 3d46d2a55..6565afcd8 100644
--- a/locks/os2/thread_mutex.c
+++ b/locks/os2/thread_mutex.c
@@ -70,6 +70,7 @@ static apr_status_t thread_mutex_cleanup(void *themutex)
APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex,
+ unsigned int flags,
apr_pool_t *pool)
{
apr_thread_mutex_t *new_mutex;
@@ -78,6 +79,7 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex,
new_mutex = (apr_thread_mutex_t *)apr_palloc(pool, sizeof(apr_thread_mutex_t));
new_mutex->pool = pool;
+ /* FIXME: Can OS/2 do nested (aka recursive) locks natively? */
rc = DosCreateMutexSem(NULL, &(new_mutex->hMutex), 0, FALSE);
*mutex = new_mutex;