diff options
author | unknown <tim@donna.mysql.com> | 2001-02-20 23:28:56 +0200 |
---|---|---|
committer | unknown <tim@donna.mysql.com> | 2001-02-20 23:28:56 +0200 |
commit | b53d7383798665d58da31b8184ad8ead2ea3f892 (patch) | |
tree | 8cd9522bc8ae0ca1cb6ddd27ab948773f5e4cc72 /innobase | |
parent | eedae8056df97110bda3d56fe30fa17120e34504 (diff) | |
parent | fc58b42fbfa0f0381efc68e5dd0f5e83f75500c1 (diff) | |
download | mariadb-git-b53d7383798665d58da31b8184ad8ead2ea3f892.tar.gz |
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
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/os0file.h | 6 | ||||
-rw-r--r-- | innobase/os/os0sync.c | 27 |
2 files changed, 26 insertions, 7 deletions
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index 5b90f24f12e..a02cd947c28 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -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__ diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c index 1647dd982f3..4c283431575 100644 --- a/innobase/os/os0sync.c +++ b/innobase/os/os0sync.c @@ -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 } |