mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge donna.mysql.com:/home/my/bk/mysql
into donna.mysql.com:/home/tim/my/work innobase/configure.in: Auto merged innobase/include/lock0types.h: Auto merged innobase/include/os0sync.h: Auto merged innobase/include/sync0types.h: Auto merged sql/ha_innobase.cc: Auto merged BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
This commit is contained in:
commit
b53d738379
7 changed files with 124 additions and 9 deletions
|
|
@ -28,6 +28,12 @@ Created 10/21/1995 Heikki Tuuri
|
|||
#define POSIX_ASYNC_IO
|
||||
#endif
|
||||
|
||||
#ifndef S_IRWXU
|
||||
#define S_IRWXU 00700
|
||||
#define S_IRWXG 00070
|
||||
#define S_IRWXO 00007
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __WIN__
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ os_event_create(
|
|||
event = ut_malloc(sizeof(struct os_event_struct));
|
||||
|
||||
os_fast_mutex_init(&(event->os_mutex));
|
||||
os_fast_mutex_init(&(event->wait_mutex));
|
||||
pthread_cond_init(&(event->cond_var), NULL);
|
||||
|
||||
event->is_set = TRUE;
|
||||
event->is_set = FALSE;
|
||||
|
||||
return(event);
|
||||
#endif
|
||||
|
|
@ -119,8 +119,8 @@ os_event_set(
|
|||
if (event->is_set) {
|
||||
/* Do nothing */
|
||||
} else {
|
||||
os_fast_mutex_unlock(&(event->wait_mutex));
|
||||
event->is_set = TRUE;
|
||||
pthread_cond_broadcast(&(event->cond_var));
|
||||
}
|
||||
|
||||
os_fast_mutex_unlock(&(event->os_mutex));
|
||||
|
|
@ -148,7 +148,6 @@ os_event_reset(
|
|||
if (!event->is_set) {
|
||||
/* Do nothing */
|
||||
} else {
|
||||
os_fast_mutex_lock(&(event->wait_mutex));
|
||||
event->is_set = FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +172,7 @@ os_event_free(
|
|||
ut_a(event);
|
||||
|
||||
os_fast_mutex_free(&(event->os_mutex));
|
||||
os_fast_mutex_free(&(event->wait_mutex));
|
||||
pthread_cond_destroy(&(event->cond_var));
|
||||
|
||||
ut_free(event);
|
||||
#endif
|
||||
|
|
@ -197,8 +196,22 @@ os_event_wait(
|
|||
|
||||
ut_a(err == WAIT_OBJECT_0);
|
||||
#else
|
||||
os_fast_mutex_lock(&(event->wait_mutex));
|
||||
os_fast_mutex_unlock(&(event->wait_mutex));
|
||||
os_fast_mutex_lock(&(event->os_mutex));
|
||||
loop:
|
||||
if (event->is_set == TRUE) {
|
||||
os_fast_mutex_unlock(&(event->os_mutex));
|
||||
|
||||
/* Ok, we may return */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
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 */
|
||||
|
||||
goto loop;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue