summaryrefslogtreecommitdiff
path: root/servers/server_wrap_mt_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/server_wrap_mt_common.h')
-rw-r--r--servers/server_wrap_mt_common.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/servers/server_wrap_mt_common.h b/servers/server_wrap_mt_common.h
index f01e0b9578..4481b296c6 100644
--- a/servers/server_wrap_mt_common.h
+++ b/servers/server_wrap_mt_common.h
@@ -57,7 +57,7 @@
virtual RID m_type##_create() { \
if (Thread::get_caller_id() != server_thread) { \
RID rid; \
- alloc_mutex->lock(); \
+ MutexLock lock(alloc_mutex); \
if (m_type##_id_pool.size() == 0) { \
int ret; \
command_queue.push_and_ret(this, &ServerNameWrapMT::m_type##allocn, &ret); \
@@ -65,7 +65,6 @@
} \
rid = m_type##_id_pool.front()->get(); \
m_type##_id_pool.pop_front(); \
- alloc_mutex->unlock(); \
return rid; \
} else { \
return server_name->m_type##_create(); \
@@ -88,7 +87,7 @@
virtual RID m_type##_create(m_arg1 p1) { \
if (Thread::get_caller_id() != server_thread) { \
RID rid; \
- alloc_mutex->lock(); \
+ MutexLock lock(alloc_mutex); \
if (m_type##_id_pool.size() == 0) { \
int ret; \
command_queue.push_and_ret(this, &ServerNameWrapMT::m_type##allocn, p1, &ret); \
@@ -96,7 +95,6 @@
} \
rid = m_type##_id_pool.front()->get(); \
m_type##_id_pool.pop_front(); \
- alloc_mutex->unlock(); \
return rid; \
} else { \
return server_name->m_type##_create(p1); \
@@ -119,7 +117,7 @@
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2) { \
if (Thread::get_caller_id() != server_thread) { \
RID rid; \
- alloc_mutex->lock(); \
+ MutexLock lock(alloc_mutex); \
if (m_type##_id_pool.size() == 0) { \
int ret; \
command_queue.push_and_ret(this, &ServerNameWrapMT::m_type##allocn, p1, p2, &ret); \
@@ -127,7 +125,6 @@
} \
rid = m_type##_id_pool.front()->get(); \
m_type##_id_pool.pop_front(); \
- alloc_mutex->unlock(); \
return rid; \
} else { \
return server_name->m_type##_create(p1, p2); \
@@ -150,7 +147,7 @@
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
if (Thread::get_caller_id() != server_thread) { \
RID rid; \
- alloc_mutex->lock(); \
+ MutexLock lock(alloc_mutex); \
if (m_type##_id_pool.size() == 0) { \
int ret; \
command_queue.push_and_ret(this, &ServerNameWrapMT::m_type##allocn, p1, p2, p3, &ret); \
@@ -158,7 +155,6 @@
} \
rid = m_type##_id_pool.front()->get(); \
m_type##_id_pool.pop_front(); \
- alloc_mutex->unlock(); \
return rid; \
} else { \
return server_name->m_type##_create(p1, p2, p3); \
@@ -181,7 +177,7 @@
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
if (Thread::get_caller_id() != server_thread) { \
RID rid; \
- alloc_mutex->lock(); \
+ MutexLock lock(alloc_mutex); \
if (m_type##_id_pool.size() == 0) { \
int ret; \
command_queue.push_and_ret(this, &ServerNameWrapMT::m_type##allocn, p1, p2, p3, p4, &ret); \
@@ -189,7 +185,6 @@
} \
rid = m_type##_id_pool.front()->get(); \
m_type##_id_pool.pop_front(); \
- alloc_mutex->unlock(); \
return rid; \
} else { \
return server_name->m_type##_create(p1, p2, p3, p4); \
@@ -213,7 +208,7 @@
virtual RID m_type##_create(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
if (Thread::get_caller_id() != server_thread) { \
RID rid; \
- alloc_mutex->lock(); \
+ MutexLock lock(alloc_mutex); \
if (m_type##_id_pool.size() == 0) { \
int ret; \
command_queue.push_and_ret(this, &ServerNameWrapMT::m_type##allocn, p1, p2, p3, p4, p5, &ret); \
@@ -221,7 +216,6 @@
} \
rid = m_type##_id_pool.front()->get(); \
m_type##_id_pool.pop_front(); \
- alloc_mutex->unlock(); \
return rid; \
} else { \
return server_name->m_type##_create(p1, p2, p3, p4, p5); \