Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1931 05/07/14 18:29:55 konstantin@stripped +4 -0
Get rid of checking for ETIME return value of pthread_cond_timedwait.
ETIME was returned by cond_timedwait (sic, the pre-POSIX1001b function) on
Solaris 2.6 and 2.7. pthread_cond_timedwait on Solaris returns ETIMEDOUT.
The standard requirement is that the only additional return value
of pthred_cond_timedwait compared to pthread_cond_wait is ETIMEDOUT.
Let us not bloat the application code with redundant checks,
and if we're ever to work on a platform that returns a non-standard
value, we should write a wrapper for that platform (like we do, e.g., for
Windows).
sql/sql_insert.cc
1.166 05/07/14 18:29:50 konstantin@stripped +1 -1
- don't check for ETIME
sql/slave.cc
1.251 05/07/14 18:29:49 konstantin@stripped +1 -1
- don't check for ETIME
sql/item_func.cc
1.231 05/07/14 18:29:49 konstantin@stripped +5 -5
- don't check for ETIME
mysys/my_os2cond.c
1.4 05/07/14 18:29:49 konstantin@stripped +1 -1
- fix our implementation of pthread_cond_timedwait on OS2 to return
ETIMEDOUT instead of ETIME.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: konstantin
# Host: dragonfly.local
# Root: /media/sda1/mysql/mysql-5.0-10760-new
--- 1.230/sql/item_func.cc 2005-07-13 23:49:40 +04:00
+++ 1.231/sql/item_func.cc 2005-07-14 18:29:49 +04:00
@@ -3157,7 +3157,7 @@
THD* thd=current_thd;
User_level_lock* ull;
struct timespec abstime;
- int lock_name_len,error=0;
+ int lock_name_len;
lock_name_len=strlen(lock_name);
pthread_mutex_lock(&LOCK_user_locks);
@@ -3191,8 +3191,8 @@
set_timespec(abstime,lock_timeout);
while (!thd->killed &&
- (error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime))
- != ETIME && error != ETIMEDOUT && ull->locked) ;
+ pthread_cond_timedwait(&ull->cond, &LOCK_user_locks,
+ &abstime) != ETIMEDOUT && ull->locked) ;
if (ull->locked)
{
if (!--ull->count)
@@ -3294,14 +3294,14 @@
set_timespec(abstime,timeout);
while (!thd->killed &&
(error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime))
- != ETIME && error != ETIMEDOUT && error != EINVAL && ull->locked) ;
+ != ETIMEDOUT && error != EINVAL && ull->locked) ;
if (thd->killed)
error=EINTR; // Return NULL
if (ull->locked)
{
if (!--ull->count)
delete ull; // Should never happen
- if (error != ETIME && error != ETIMEDOUT)
+ if (error != ETIMEDOUT)
{
error=1;
null_value=1; // Return NULL
--- 1.250/sql/slave.cc 2005-07-13 06:00:47 +04:00
+++ 1.251/sql/slave.cc 2005-07-14 18:29:49 +04:00
@@ -2753,7 +2753,7 @@
else
pthread_cond_wait(&data_cond, &data_lock);
DBUG_PRINT("info",("Got signal of master update or timed out"));
- if (error == ETIMEDOUT || error == ETIME)
+ if (error == ETIMEDOUT)
{
error= -1;
break;
--- 1.165/sql/sql_insert.cc 2005-07-14 00:20:37 +04:00
+++ 1.166/sql/sql_insert.cc 2005-07-14 18:29:50 +04:00
@@ -1730,7 +1730,7 @@
#endif
if (thd->killed || di->status)
break;
- if (error == ETIME || error == ETIMEDOUT)
+ if (error == ETIMEDOUT)
{
thd->killed= THD::KILL_CONNECTION;
break;
--- 1.3/mysys/my_os2cond.c 2003-01-28 09:38:22 +03:00
+++ 1.4/mysys/my_os2cond.c 2005-07-14 18:29:49 +04:00
@@ -100,7 +100,7 @@
rc = DosWaitEventSem(cond->semaphore, timeout);
if (rc != 0)
- rval = ETIME;
+ rval= ETIMEDOUT;
if (mutex) pthread_mutex_lock(mutex);
| Thread |
|---|
| • bk commit into 5.0 tree (konstantin:1.1931) | konstantin | 14 Jul |