Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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@stripped, 2007-01-29 17:39:28+04:00, holyfoot@stripped +2 -0
bug #25895 (compiling the embedded server fails on some 64-bit platforms)
it can't be compile everywhere if we just cast pointer to pthread_t
So now we use correct pthread_self() value as the pthread_t and
pointer where we need to identify the thread exactly.
libmysqld/lib_sql.cc@stripped, 2007-01-29 17:39:26+04:00, holyfoot@stripped +1 -1
pthread_self() can be used here as we use pointer to thread
when we need to identify the thread exactly
sql/item_func.cc@stripped, 2007-01-29 17:39:26+04:00, holyfoot@stripped +10 -4
now we use pthread_t value for thread identification in 'standalone'
server only, in the embedded server we can use the pointer to THD
structure
# 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: holyfoot
# Host: hfmain.(none)
# Root: /home/hf/work/mysql-5.1.embf
--- 1.349/sql/item_func.cc 2007-01-29 17:39:32 +04:00
+++ 1.350/sql/item_func.cc 2007-01-29 17:39:32 +04:00
@@ -3085,7 +3085,13 @@ public:
int count;
bool locked;
pthread_cond_t cond;
+#ifndef EMBEDDED_LIBRARY
pthread_t thread;
+ void set_thread(THD *thd) { thread= thd->real_id; }
+#else
+ THD *thread;
+ void set_thread(THD *thd) { thread= thd; }
+#endif /*EMBEDDED_LIBRARY*/
ulong thread_id;
User_level_lock(const char *key_arg,uint length, ulong id)
@@ -3239,7 +3245,7 @@ void debug_sync_point(const char* lock_n
else
{
ull->locked=1;
- ull->thread=thd->real_id;
+ ull->set_thread(thd);
thd->ull=ull;
}
pthread_mutex_unlock(&LOCK_user_locks);
@@ -3314,7 +3320,7 @@ longlong Item_func_get_lock::val_int()
null_value=1; // Probably out of memory
return 0;
}
- ull->thread=thd->real_id;
+ ull->set_thread(thd);
thd->ull=ull;
pthread_mutex_unlock(&LOCK_user_locks);
return 1; // Got new lock
@@ -3355,7 +3361,7 @@ longlong Item_func_get_lock::val_int()
else // We got the lock
{
ull->locked=1;
- ull->thread=thd->real_id;
+ ull->set_thread(thd);
ull->thread_id= thd->thread_id;
thd->ull=ull;
error=0;
@@ -3404,7 +3410,7 @@ longlong Item_func_release_lock::val_int
else
{
#ifdef EMBEDDED_LIBRARY
- if (ull->locked && pthread_equal(current_thd->real_id,ull->thread))
+ if (ull->locked && (current_thd == ull->thread))
#else
if (ull->locked && pthread_equal(pthread_self(),ull->thread))
#endif
--- 1.127/libmysqld/lib_sql.cc 2007-01-29 17:39:32 +04:00
+++ 1.128/libmysqld/lib_sql.cc 2007-01-29 17:39:32 +04:00
@@ -593,7 +593,7 @@ void *create_embedded_thd(int client_fla
thd->set_time();
thd->init_for_queries();
thd->client_capabilities= client_flag;
- thd->real_id= (pthread_t) thd;
+ thd->real_id= pthread_self();
thd->db= NULL;
thd->db_length= 0;
| Thread |
|---|
| • bk commit into 5.1 tree (holyfoot:1.2413) BUG#25895 | holyfoot | 29 Jan |