summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 18:34:38 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 18:34:38 (GMT)
commit44e48eca5ffaa2ca70161e6e1cde347d64aa2ed2 (patch)
treef352a15fa1f4f7e22de95a98fe7850dc3969522b /thread_sync.c
parent79d99551801812f2513dacc73b6dea716cc07096 (diff)
thread_sync.c: rename mutex_waiter struct to sync_waiter
We will reuse this struct for ConditionVariable, Queue, and SizedQueue, so it is no longer Mutex-specific. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/thread_sync.c b/thread_sync.c
index d33b221..b702f6a 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -6,8 +6,8 @@ static VALUE rb_eClosedQueueError;
/* Mutex */
-/* mutex_waiter is always on-stack */
-struct mutex_waiter {
+/* sync_waiter is always on-stack */
+struct sync_waiter {
rb_thread_t *th;
struct list_node node;
};
@@ -60,7 +60,7 @@ static const char* rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *t
static size_t
rb_mutex_num_waiting(rb_mutex_t *mutex)
{
- struct mutex_waiter *w = 0;
+ struct sync_waiter *w = 0;
size_t n = 0;
list_for_each(&mutex->waitq, w, node) {
@@ -213,7 +213,7 @@ rb_mutex_lock(VALUE self)
}
if (rb_mutex_trylock(self) == Qfalse) {
- struct mutex_waiter w;
+ struct sync_waiter w;
if (mutex->th == th) {
rb_raise(rb_eThreadError, "deadlock; recursive locking");
@@ -300,7 +300,7 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th)
err = "Attempt to unlock a mutex which is locked by another thread";
}
else {
- struct mutex_waiter *cur = 0, *next = 0;
+ struct sync_waiter *cur = 0, *next = 0;
rb_mutex_t *volatile *th_mutex = &th->keeping_mutexes;
mutex->th = 0;