Commit 6b0f2ce5 authored by Marko Mäkelä's avatar Marko Mäkelä

fixup 6b2d1766

parent 6b2d1766
...@@ -52,25 +52,18 @@ inline void srw_lock_low::readers_wait(uint32_t l) ...@@ -52,25 +52,18 @@ inline void srw_lock_low::readers_wait(uint32_t l)
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
#if 0
inline void srw_lock_low::writer_wake()
{
pthread_mutex_lock(&mutex);
pthread_cond_broadcast(&cond_ex);
if (!(value() & WRITER_PENDING))
pthread_cond_broadcast(&cond);
pthread_mutex_unlock(&mutex);
}
#endif
inline void srw_lock_low::writer_wake() inline void srw_lock_low::writer_wake()
{ {
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
uint32_t l= value(); uint32_t l= value();
if (!(l & WRITER)) if (l & WRITER)
pthread_cond_broadcast((l & WRITER_PENDING) ? &cond_ex : &cond);
else
DBUG_ASSERT(!(l & ~WRITER_PENDING)); DBUG_ASSERT(!(l & ~WRITER_PENDING));
else
{
pthread_cond_broadcast(&cond_ex);
if (!(l & WRITER_PENDING))
pthread_cond_broadcast(&cond);
}
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
# define readers_wake writer_wake # define readers_wake writer_wake
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment