summaryrefslogtreecommitdiff
path: root/innobase/os
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-07-03 21:25:55 +0300
committerunknown <heikki@hundin.mysql.fi>2003-07-03 21:25:55 +0300
commit5dc1e4b98ac6223b9854f26fd689d7e68897e3c9 (patch)
tree4bae1e813c986da0cdde9b78f41247a806c985d0 /innobase/os
parentdb5283b30667c9d427228069314f53d38c4ef8f1 (diff)
downloadmariadb-git-5dc1e4b98ac6223b9854f26fd689d7e68897e3c9.tar.gz
Many files:
Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush os0sync.h, os0sync.c: Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be innobase/os/os0sync.c: Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be innobase/include/os0sync.h: Fix a bug in os_event on Unix: even though we signaled the event, some threads could continue waiting if the event became nonsignaled quickly again; this made group commit less efficient than it should be innobase/log/log0log.c: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush innobase/include/log0log.h: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush innobase/srv/srv0srv.c: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush innobase/row/row0mysql.c: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush innobase/trx/trx0trx.c: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush sql/ha_innodb.cc: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush innobase/btr/btr0btr.c: Remove potential starvation of a full log buffer flush: only flush up to the lsn which was the largest at the time when we requested the full log buffer flush
Diffstat (limited to 'innobase/os')
-rw-r--r--innobase/os/os0sync.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c
index bf5fc57bf57..827d68501db 100644
--- a/innobase/os/os0sync.c
+++ b/innobase/os/os0sync.c
@@ -143,6 +143,7 @@ os_event_create(
ut_a(0 == pthread_cond_init(&(event->cond_var), NULL));
#endif
event->is_set = FALSE;
+ event->signal_count = 0;
#endif /* __WIN__ */
/* Put to the list of events */
@@ -218,6 +219,7 @@ os_event_set(
/* Do nothing */
} else {
event->is_set = TRUE;
+ event->signal_count += 1;
ut_a(0 == pthread_cond_broadcast(&(event->cond_var)));
}
@@ -310,9 +312,15 @@ os_event_wait(
os_thread_exit(NULL);
}
#else
+ ib_longlong old_signal_count;
+
os_fast_mutex_lock(&(event->os_mutex));
+
+ old_signal_count = event->signal_count;
loop:
- if (event->is_set == TRUE) {
+ if (event->is_set == TRUE
+ || event->signal_count != old_signal_count) {
+
os_fast_mutex_unlock(&(event->os_mutex));
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
@@ -326,8 +334,9 @@ loop:
pthread_cond_wait(&(event->cond_var), &(event->os_mutex));
- /* Solaris manual said that spurious wakeups may occur: we have
- to check the 'is_set' variable again */
+ /* Solaris manual said that spurious wakeups may occur: we have to
+ check if the event really has been signaled after we came here to
+ wait */
goto loop;
#endif